Function encapsulateWithPublicKey

  • Key Encapsulation Mechanism (KEM). This encapsulates a JWK with a public key and produces a custom JWE. This applies the ECIES protocol in encryptWithPublicKey from libsodium to JWE. This JWE uses custom header properties.

    For ECDH-SS:

    • alg: "ECDH-SS-NaCl"
    • enc: "XSalsa20-Poly1305"

    For ECDH-ES:

    • alg: "ECDH-ES-NaCl"
    • enc: "XSalsa20-Poly1305"

    Parameters

    Returns JWKEncrypted

Generated using TypeDoc