A set of parameters for building a cipher suite.
If the error occurred, throws InvalidParamError.
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.
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.
Optional
aad: ArrayBufferAdditional 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.
Optional
aad: ArrayBufferAdditional 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 is implemented using only Web Cryptography API.
This is the super class of CipherSuite and the same as @hpke/core#CipherSuite as follows: which supports only the ciphersuites that can be implemented on the native Web Cryptography API. Therefore, the following cryptographic algorithms are not supported for now:
In addtion, the HKDF functions contained in this class can only derive keys of the same length as the
hashSize
.If you want to use the unsupported cryptographic algorithms above or derive keys longer than the
hashSize
, please use CipherSuite.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 by Web Cryptography API.
Example: Use a ciphersuite which is currently not supported by Web Cryptography API.