MdecapsulateKey
Bun

method

crypto.webcrypto.SubtleCrypto.decapsulateKey

decapsulationAlgorithm: AlgorithmIdentifier,
decapsulationKey: CryptoKey,
ciphertext: BufferSource,
extractable: boolean,
usages: KeyUsage[]
): Promise<CryptoKey>;

A message recipient uses their asymmetric private key to decrypt an "encapsulated key" (ciphertext), thereby recovering a temporary symmetric key (represented as CryptoKey) which is then used to decrypt a message.

The algorithms currently supported include:

  • 'ML-KEM-512'
  • 'ML-KEM-768'
  • 'ML-KEM-1024'
@param usages
@returns

Fulfills with CryptoKey upon success.