as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
Provides support for building contexts for asymmetric cryptographic operations.

Extends

  • BaseCryptoClass

Extended by

Constructors

new AsymmetricCipherContextBuilder()

new AsymmetricCipherContextBuilder(): AsymmetricCipherContextBuilder

Returns

AsymmetricCipherContextBuilder

Methods

buildDecryptionContext()

buildDecryptionContext(key: PrivateKey): 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.

Throws

Returns

DecryptionContext DecryptionContext A decryption context.

buildEncryptionContext()

buildEncryptionContext(key: PublicKey): 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.

Throws

Returns

EncryptionContext EncryptionContext An encryption context.

buildWrappingContext()

buildWrappingContext(pubKey: PublicKey, privKey: PrivateKey, scheme: WrappingScheme): 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
PublicKey The public key. Required for wrapping operations.
privKey
PrivateKey The private key. Required for unwrapping operations.
scheme
WrappingScheme The wrapping scheme to be used.

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.
  • NotSupportedError If the implementation does not support wrapping operations.

Returns

WrappingContext WrappingContext A wrapping context.
最后修改于 2026年8月25日