import { type KemInterface } from "https://deno.land/x/hpke@1.2.9/core/mod.ts";
The KEM interface.
Properties
The KEM identifier.
The length in bytes of a KEM shared secret produced by this KEM (Nsecret).
Methods
Serializes a public key as CryptoKey to a byte string of length Npk
.
If the error occurred, throws SerializeError.
Deserializes a public key as a byte string of length Npk
to CryptoKey.
If the error occurred, throws DeserializeError.
Serializes a private key as CryptoKey to a byte string of length Nsk
.
If the error occurred, throws SerializeError.
Deserializes a private key as a byte string of length Nsk
to CryptoKey.
If the error occurred, throws DeserializeError.
Imports a public or private key and converts to a CryptoKey.
Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.
Basically, this is a thin wrapper function of SubtleCrypto.importKey.
If the error occurred, throws DeserializeError.
Generates a key pair.
If the error occurred, throws NotSupportedError.
Derives a key pair from the byte string ikm.
If the error occurred, throws DeriveKeyPairError.
Generates an ephemeral, fixed-length symmetric key and
a fixed-length encapsulation of the key that can be decapsulated
by the holder of the private key corresponding to pkR
.
If the error occurred, throws EncapError.
Recovers the ephemeral symmetric key from its encapsulated representation enc
.
If the error occurred, throws DecapError.