as

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

RsaOaepContextBuilder

RsaOaepContextBuilder

使用最优非对称加密填充 (OAEP) 构建RSA加密上下文。

扩展

访问器

digestAlgorithm

设置签名

set digestAlgorithm(digest): void

指定要使用的摘要算法。

抛出

如果不支持摘要算法,则抛出InvalidArgumentError

参数
digest

DigestAlgorithm

与RSA-OAEP配合使用的摘要算法。

返回值

void

方法

buildDecryptionContext()

buildDecryptionContext(key): DecryptionContext

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

参数

key

PrivateKey

用于解密的私钥。

返回值

DecryptionContext

解密上下文。

抛出

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

继承自

AsymmetricCipherContextBuilder.buildDecryptionContext


buildEncryptionContext()

buildEncryptionContext(key): EncryptionContext

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

参数

key

PublicKey

用于加密的公钥。

返回值

EncryptionContext

加密上下文。

抛出

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

继承自

AsymmetricCipherContextBuilder.buildEncryptionContext


buildWrappingContext()

buildWrappingContext(pubKey, privKey, scheme): WrappingContext

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

参数

pubKey

PublicKey

公钥。封装操作必需。

privKey

PrivateKey

私钥。解封操作必需。

scheme

WrappingScheme

要使用的封装方案。

返回值

WrappingContext

封装上下文。

抛出

发生以下情况时,抛出AccessDeniedError

抛出

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

继承自

AsymmetricCipherContextBuilder.buildWrappingContext


Last updated: 2025年10月2日