Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
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
DigestAlgorithm 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
PrivateKey The private key to use for decryption.

Returns

DecryptionContext 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
PublicKey The public key to use for encryption.

Returns

EncryptionContext An encryption context.

Throws

AccessDeniedError If the key lacks the KeyPurpose.ENCRYPT purpose.

Inherited from

AsymmetricCipherContextBuilder.buildEncryptionContext
Last modified on October 2, 2025