Skip to main content

Module rsa_oaep_encrypt

Module rsa_oaep_encrypt 

Source
Expand description

RSA-OAEP encryption-key minting (RFC 8017 §7.1), as the Web Cryptography API serves it: the public half of key transport.

The variant binds the digest at mint (WebCrypto’s RsaHashedImportParams); the MGF1 digest is the same digest, as WebCrypto fixes it. Keys report algorithm-name "RSA-OAEP", the variant’s digest, and the modulus length.

Admission tightens the family window on both ends: the modulus must be 2048–8192 bits, error.invalid-key outside — encryption creates future artifacts, so unlike signature verification there is no legacy tier below 2048 (see README.md, “Design notes”). The plaintext bound follows from the mint: modulus bytes minus twice the digest length minus 2.

Functions§

import_encryption_key_jwk
Import a public key as an RSA public JWK (kty: "RSA", with n and e). An alg member, when present, must be the variant’s JOSE alg ("RSA-OAEP-256", "RSA-OAEP-384", or "RSA-OAEP-512"). See mac-key.export-key-jwk for the package-wide JWK contract.
import_encryption_key_spki
Import a public key as an X.509 SubjectPublicKeyInfo (DER). Admission follows the family contract (see rsa) plus the window above.

Type Aliases§

EncryptionKey
Error
RsaVariant