Skip to main content

Module rsa_oaep

Module rsa_oaep 

Source
Expand description

rsa-oaep-encrypt key creation (RFC 8017 §7.1) — the public half of key transport — plus, behind the rsa-oaep-decrypt cargo feature, rsa-oaep-decrypt.

The declared variant binds the digest at mint; the MGF1 digest is the same digest. Admission tightens the RSA family contract on both ends: the modulus must be 2048–8192 bits (see the WIT rsa-oaep-encrypt interface). 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, as JSON text). An alg member, when present, must be the variant’s JOSE alg ("RSA-OAEP-256", "RSA-OAEP-384", or "RSA-OAEP-512"). See the WIT mac-key.export-key-jwk doc for the package-wide JWK contract.
import_encryption_key_spki
Import a public key as an X.509 SubjectPublicKeyInfo (DER). Admission follows the RSA family contract (see the WIT rsa interface) plus the 2048–8192-bit window.

Type Aliases§

RsaVariant