subtle.exportKey(format, key)


版本历史
版本变更
v24.8.0

现在支持 KMAC 算法。

v24.7.0

现在支持 ML-KEM 算法。

v24.7.0

现在支持 ChaCha20-Poly1305 算法。

v24.7.0

现在支持 ML-DSA 算法。

v18.4.0, v16.17.0

添加了 'Ed25519''Ed448''X25519''X448' 算法。

v15.9.0

删除了 'NODE-DSA' JWK 导出。

v15.0.0

新增于: v15.0.0

如果支持,将给定的密钥导出为指定的格式。

\Exports the given key into the specified format, if supported.

如果 <CryptoKey> 不可提取,则返回的 promise 将被拒绝。

\If the <CryptoKey> is not extractable, the returned promise will reject.

format'pkcs8''spki' 且导出成功时,返回的 promise 将使用包含导出密钥数据的 <ArrayBuffer> 进行解析。

\When format is either 'pkcs8' or 'spki' and the export is successful, the returned promise will be resolved with an <ArrayBuffer> containing the exported key data.

format'jwk' 且导出成功时,返回的 promise 将使用符合 JSON 网络密钥 规范的 JavaScript 对象解析。

\When format is 'jwk' and the export is successful, the returned promise will be resolved with a JavaScript object conforming to the JSON Web Key specification.

支持的密钥算法'spki''pkcs8''jwk''raw''raw-secret''raw-public''raw-seed'
'AES-CBC'
'AES-CTR'
'AES-GCM'
'AES-KW'
'AES-OCB'[^modern-algos]
'ChaCha20-Poly1305'[^modern-algos]
'ECDH'
'ECDSA'
'Ed25519'
'Ed448'[^secure-curves]
'HMAC'
'KMAC128'[^modern-algos]
'KMAC256'[^modern-algos]
'ML-DSA-44'[^modern-algos]
'ML-DSA-65'[^modern-algos]
'ML-DSA-87'[^modern-algos]
'ML-KEM-512'[^modern-algos]
'ML-KEM-768'[^modern-algos]
'ML-KEM-1024'[^modern-algos]
'RSA-OAEP'
'RSA-PSS'
'RSASSA-PKCS1-v1_5'

AltStyle によって変換されたページ (->オリジナル) /