docs/jwe/general/encrypt/interfaces/Recipient.md
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.
āø addRecipient(key, options?): Recipient
Adds another recipient to the enclosing GeneralEncrypt and returns its configuration.
| Parameter | Type | Description |
|---|---|---|
key | KeyInput | Public key or shared secret. See Algorithm Key Requirements. |
options? | CritOption | JWE Encryption options. |
Recipient
āø done(): GeneralEncrypt
Returns the enclosing GeneralEncrypt instance.
āø encrypt(): Promise<GeneralJWE>
Encrypts for all recipients on the enclosing GeneralEncrypt, using their configured keys.
āø 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.
| Parameter | Type | Description |
|---|---|---|
parameters | JWEKeyManagementHeaderParameters | JWE Key Management parameters. |
Recipient
āø setUnprotectedHeader(unprotectedHeader): Recipient
Sets the JWE Per-Recipient Unprotected Header. May only be called once.
| Parameter | Type | Description |
|---|---|---|
unprotectedHeader | JWEHeaderParameters | JWE Per-Recipient Unprotected Header. |
Recipient