as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持

AsymmetricCipherContextBuilder

AsymmetricCipherContextBuilder

为构建非对称加密操作的上下文提供支持。

扩展

  • BaseCryptoClass

扩展自

方法

buildDecryptionContext()

buildDecryptionContext(key): DecryptionContext

使用给定的私钥构建解密上下文。此上下文可用于解密由对应公钥加密的数据。

参数

key

PrivateKey

用于解密的私钥。

返回值

DecryptionContext

解密上下文。

抛出

如果密钥缺少KeyPurpose.DECRYPT用途,则抛出AccessDeniedError


buildEncryptionContext()

buildEncryptionContext(key): EncryptionContext

使用给定的公钥构建加密上下文。此上下文可用于加密只有对应私钥的持有者才能解密的数据。

参数

key

PublicKey

用于加密的公钥。

返回值

EncryptionContext

加密上下文。

抛出

如果密钥缺少KeyPurpose.ENCRYPT用途,则抛出AccessDeniedError


buildWrappingContext()

buildWrappingContext(pubKey, privKey, scheme): WrappingContext

使用给定的公钥/私钥和包装方案构建包装上下文。此上下文可用于密钥包装操作,包括对加密密钥进行加密。

参数

pubKey

PublicKey

公钥。打包操作必需。

privKey

PrivateKey

私钥。解包操作必需。

scheme

WrappingScheme

要使用的包装方案。

返回值

WrappingContext

包装上下文。

抛出

发生以下情况时,抛出AccessDeniedError

抛出

如果该实现不支持包装操作,则抛出NotSupportedError


Last updated: 2025年10月2日