Interface: Recipient
September 11, 2026 ยท View on GitHub
๐ Help the project
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.
Configures an individual recipient in a General JWE.
Methods
addRecipient()
โธ addRecipient(key, options?): Recipient
Adds another recipient to the enclosing GeneralEncrypt and returns its configuration.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | KeyInput | Public key or shared secret. See Algorithm Key Requirements. |
options? | CritOption | JWE Encryption options. |
Returns
Recipient
done()
โธ done(): GeneralEncrypt
Returns the enclosing GeneralEncrypt instance.
Returns
encrypt()
โธ encrypt(): Promise<GeneralJWE>
Encrypts for all recipients on the enclosing GeneralEncrypt, using their configured keys.
Returns
setKeyManagementParameters()
โธ setKeyManagementParameters(parameters): Recipient
Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead of header setters; the resulting parameters are added to the JOSE Header. May only be called once.
Parameters
| Parameter | Type | Description |
|---|---|---|
parameters | JWEKeyManagementHeaderParameters | JWE Key Management parameters. |
Returns
Recipient
setUnprotectedHeader()
โธ setUnprotectedHeader(unprotectedHeader): Recipient
Sets the JWE Per-Recipient Unprotected Header. May only be called once.
Parameters
| Parameter | Type | Description |
|---|---|---|
unprotectedHeader | JWEHeaderParameters | JWE Per-Recipient Unprotected Header. |
Returns
Recipient