A set of parameters for building a cipher suite.
Gets the AEAD context of the ciphersuite.
Gets the KDF context of the ciphersuite.
Gets the KEM context of the ciphersuite.
Protected
_setupCreates an encryption context for a recipient.
If the error occurred, throws DecapError | DeserializeError | ValidationError.
A set of parameters for the recipient encryption context.
A recipient encryption context.
Creates an encryption context for a sender.
If the error occurred, throws DecapError | ValidationError.
A set of parameters for the sender encryption context.
A sender encryption context.
Derives a key pair for the cipher suite in the manner defined in RFC9180 Section 7.1.3.
If the error occurred, throws DeriveKeyPairError.
A byte string of input keying material. The maximum length is 128 bytes.
A key pair derived.
Use KemInterface.deriveKeyPair instead.
Generates a key pair for the cipher suite.
If the error occurred, throws NotSupportedError.
A key pair generated.
Use KemInterface.generateKeyPair instead.
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.
For now, 'raw'
and 'jwk'
are supported.
A byte string of a raw key or A JsonWebKey object.
The indicator whether the provided key is a public key or not, which is used only for 'raw'
format.
A public or private CryptoKey.
Use KemInterface.generateKeyPair instead.
Decrypts a message from a sender.
If the error occurred, throws DecapError
| DeserializeError
| OpenError
| ValidationError
.
A set of parameters for building a recipient encryption context.
An encrypted text as bytes to be decrypted.
Additional authenticated data as bytes fed by an application.
A decrypted plain text as bytes.
Encrypts a message to a recipient.
If the error occurred, throws EncapError
| MessageLimitReachedError
| SealError
| ValidationError
.
A set of parameters for building a sender encryption context.
A plain text as bytes to be encrypted.
Additional authenticated data as bytes fed by an application.
A cipher text and an encapsulated key as bytes.
The Hybrid Public Key Encryption (HPKE) ciphersuite, which supports all of the ciphersuites defined in RFC9180.
The class consists of the @hpke/core, @hpke/chcha20poly1305, @hpke/dhkem-x25519 and @hpke/dhkem-x448 internally.
This class provides following functions:
The calling of the constructor of this class is the starting point for HPKE operations for both senders and recipients.
Example: Use only ciphersuites supported internally.
Example: Use a ciphersuite consisting of an external module.