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.
Used to build General JWE object's individual recipients.
āø addRecipient(key, options?): Recipient
A shorthand for calling addRecipient() on the enclosing GeneralEncrypt instance.
| Parameter | Type | Description |
|---|---|---|
key | KeyInput | Public Key or Secret to encrypt the Content Encryption Key for the recipient with. See Algorithm Key Requirements. |
options? | CritOption | JWE Encryption options. |
Recipient
āø done(): GeneralEncrypt
Returns the enclosing GeneralEncrypt instance
āø encrypt(): Promise<GeneralJWE>
A shorthand for calling encrypt() on the enclosing GeneralEncrypt instance. Takes no arguments ā each recipient's key is supplied to addRecipient.
āø setKeyManagementParameters(parameters): Recipient
Sets the JWE Key Management parameters to be used when encrypting. Use this method instead of the header setters to configure algorithm inputs such as ECDH-ES "apu" (Agreement PartyUInfo) and "apv" (Agreement PartyVInfo), or PBES2 "p2c" (PBES2 Count). The parameters are added to the appropriate JOSE Header.
| Parameter | Type | Description |
|---|---|---|
parameters | JWEKeyManagementHeaderParameters | JWE Key Management parameters. |
Recipient
āø setUnprotectedHeader(unprotectedHeader): Recipient
Sets the JWE Per-Recipient Unprotected Header on the Recipient object.
| Parameter | Type | Description |
|---|---|---|
unprotectedHeader | JWEHeaderParameters | JWE Per-Recipient Unprotected Header. |
Recipient