subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)
format: <string> 必须是'raw'、'pkcs8'、'spki'或'jwk'之一。wrappedKey: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>unwrappingKey: <CryptoKey>
unwrapAlgo: <AlgorithmIdentifier> | <RsaOaepParams> | <AesCtrParams> | <AesCbcParams> | <AesGcmParams>unwrappedKeyAlgo: <AlgorithmIdentifier> | <RsaHashedImportParams> | <EcKeyImportParams> | <HmacImportParams>
extractable: <boolean>keyUsages: <string[]> 参见 主要用途。- 返回:<Promise> 以 <CryptoKey> 完成
在密码学中,“封装密钥”指的是导出然后加密密钥材料。subtle.unwrapKey() 方法尝试解密一个封装的密钥并创建一个 <CryptoKey> 实例。它等同于先对加密的密钥数据调用 subtle.decrypt()(使用 wrappedKey、unwrapAlgo 和 unwrappingKey 参数作为输入),然后将结果传入 subtle.importKey() 方法,使用 unwrappedKeyAlgo、extractable 和 keyUsages 参数作为输入。如果成功,返回的 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:】