as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
为构建非对称加密操作的上下文提供支持。

扩展

  • BaseCryptoClass

扩展自

构造函数

new AsymmetricCipherContextBuilder()

new AsymmetricCipherContextBuilder(): AsymmetricCipherContextBuilder

返回值

AsymmetricCipherContextBuilder

方法

buildDecryptionContext()

buildDecryptionContext(key: PrivateKey): DecryptionContext 使用给定的私钥构建解密上下文。此上下文可用于解密由对应公钥加密的数据。

参数

key
PrivateKey 用于解密的私钥。

抛出

  • 如果密钥缺少用途。

返回值

DecryptionContext DecryptionContext 解密上下文。

buildEncryptionContext()

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

参数

key
PublicKey 用于加密的公钥。

抛出

  • 如果密钥缺少用途。

返回值

EncryptionContext EncryptionContext 加密上下文。

buildWrappingContext()

buildWrappingContext(pubKey: PublicKey, privKey: PrivateKey, scheme: WrappingScheme): WrappingContext 使用给定的公钥/私钥和封装方案构建封装上下文。此上下文可用于密钥封装操作,包括对加密密钥进行加密。

参数

pubKey
PublicKey 公钥。封装操作必需。
privKey
PrivateKey 私钥。解封操作必需。
scheme
WrappingScheme 要使用的封装方案。

抛出

  • 在以下情况下抛出:
  • 提供了公钥,但该密钥缺少用途。
  • 提供了私钥,但该密钥缺少用途。
  • 如果该实现不支持封装操作。

返回值

WrappingContext WrappingContext 封装上下文。
最后修改于 2026年10月26日