subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, usages)
稳定性: 1.1 - 处于活跃开发中
encapsulationAlgorithm<string>encapsulationKey<CryptoKey>sharedKeyAlgorithm<string> | <HmacImportParams>extractable<boolean>usages<string[]> 参见 主要用途。- 返回:<Promise> 在成功时以 EncapsulatedKey 完成。
使用消息接收者的非对称公钥来加密一个临时对称密钥。这个加密后的密钥就是所谓的“封装密钥”,表示为 EncapsulatedKey。
【Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. This encrypted key is the "encapsulated key" represented as EncapsulatedKey.】
目前支持的算法包括:
【The algorithms currently supported include:】
'ML-KEM-512'[^现代算法]'ML-KEM-768'[^现代算法]'ML-KEM-1024'[^现代算法]