subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)
-
format
:<string> 必须是'raw'
、'pkcs8'
、'spki'
或'jwk'
之一。¥
format
: <string> Must be one of'raw'
,'pkcs8'
,'spki'
, or'jwk'
. -
wrappedKey
:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
unwrappingKey
:<CryptoKey>
-
unwrapAlgo
:<AlgorithmIdentifier> | <RsaOaepParams> | <AesCtrParams> | <AesCbcParams> | <AesGcmParams> -
unwrappedKeyAlgo
:<AlgorithmIdentifier> | <RsaHashedImportParams> | <EcKeyImportParams> | <HmacImportParams>
-
extractable
:<boolean> -
keyUsages
:<string[]> 参见 关键用法。¥
keyUsages
: <string[]> See Key usages. -
返回:<Promise> 满足 <CryptoKey>
¥Returns: <Promise> Fulfills with a <CryptoKey>
在密码学中,"封装密钥" 指的是导出然后加密密钥材料。subtle.unwrapKey()
方法尝试解密封装密钥并创建 <CryptoKey> 实例。它等效于首先对加密密钥数据调用 subtle.decrypt()
(使用 wrappedKey
、unwrapAlgo
和 unwrappingKey
参数作为输入),然后使用 unwrappedKeyAlgo
、extractable
和 keyUsages
参数作为输入将结果传递给 subtle.importKey()
方法。如果成功,返回的 promise 将使用 <CryptoKey> 对象解析。
¥In cryptography, "wrapping a key" refers to exporting and then encrypting the
keying material. The subtle.unwrapKey()
method attempts to decrypt a wrapped
key and create a <CryptoKey> instance. It is equivalent to calling
subtle.decrypt()
first on the encrypted key data (using the wrappedKey
,
unwrapAlgo
, and unwrappingKey
arguments as input) then passing the results
in to the subtle.importKey()
method using the unwrappedKeyAlgo
,
extractable
, and keyUsages
arguments as inputs. If successful, the returned
promise is resolved with a <CryptoKey> object.
目前支持的环绕算法包括:
¥The wrapping algorithms currently supported include:
-
'RSA-OAEP'
-
'AES-CTR'
-
'AES-CBC'
-
'AES-GCM'
-
'AES-KW'
支持的解包密钥算法包括:
¥The unwrapped key algorithms supported include: