RsaOaepContextBuilder
Builds contexts for RSA encryption using OAEP (Optimal Asymmetric Encryption Padding).
Extends
Accessors
digestAlgorithm
Set Signature
set digestAlgorithm(
digest
):void
Specify the digest algorithm to use.
Throws
InvalidArgumentError If the digest algorithm is not supported.
Parameters
digest
The digest algorithm to use with RSA-OAEP.
Returns
void
Methods
buildDecryptionContext()
buildDecryptionContext(
key
):DecryptionContext
Build a decryption context using the given private key. This context can be used to decrypt data that was encrypted with the corresponding public key.
Parameters
key
The private key to use for decryption.
Returns
A decryption context.
Throws
AccessDeniedError If the key lacks the KeyPurpose.DECRYPT purpose.
Inherited from
AsymmetricCipherContextBuilder
.buildDecryptionContext
buildEncryptionContext()
buildEncryptionContext(
key
):EncryptionContext
Build an encryption context using the given public key. This context can be used to encrypt data that only the holder of the corresponding private key can decrypt.
Parameters
key
The public key to use for encryption.
Returns
An encryption context.
Throws
AccessDeniedError If the key lacks the KeyPurpose.ENCRYPT purpose.
Inherited from
AsymmetricCipherContextBuilder
.buildEncryptionContext
buildWrappingContext()
buildWrappingContext(
pubKey
,privKey
,scheme
):WrappingContext
Build a wrapping context using the given public/private key and wrapping scheme. This context can be used for key wrapping operations, which involve encrypting cryptographic keys.
Parameters
pubKey
The public key. Required for wrapping operations.
privKey
The private key. Required for unwrapping operations.
scheme
The wrapping scheme to be used.
Returns
A wrapping context.
Throws
AccessDeniedError Thrown when:
- A public key is provided but the key lacks the KeyPurpose.WRAP purpose.
- A private key is provided but the key lacks the KeyPurpose.UNWRAP purpose.
Throws
NotSupportedError If the implementation does not support wrapping operations.
Inherited from
AsymmetricCipherContextBuilder
.buildWrappingContext
Last updated: Sep 30, 2025