2.8 KiB
Interface: Recipient
💗 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.
Used to build General JWE object's individual recipients.
Methods
addRecipient()
â–¸ addRecipient(key, options?): Recipient
A shorthand for calling addRecipient() on the enclosing GeneralEncrypt instance.
Parameters
| 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. |
Returns
Recipient
done()
â–¸ done(): GeneralEncrypt
Returns the enclosing GeneralEncrypt instance
Returns
encrypt()
â–¸ encrypt(): Promise<GeneralJWE>
A shorthand for calling encrypt() on the enclosing GeneralEncrypt instance. Takes no arguments — each recipient's key is supplied to addRecipient.
Returns
setKeyManagementParameters()
â–¸ setKeyManagementParameters(parameters): Recipient
Sets the JWE Key Management parameters to be used when encrypting. For ECDH based algorithms, use this method to set the "apu" (Agreement PartyUInfo) or "apv" (Agreement PartyVInfo) parameters.
Parameters
| Parameter | Type | Description |
|---|---|---|
parameters |
JWEKeyManagementHeaderParameters |
JWE Key Management parameters. |
Returns
Recipient
setUnprotectedHeader()
â–¸ setUnprotectedHeader(unprotectedHeader): Recipient
Sets the JWE Per-Recipient Unprotected Header on the Recipient object.
Parameters
| Parameter | Type | Description |
|---|---|---|
unprotectedHeader |
JWEHeaderParameters |
JWE Per-Recipient Unprotected Header. |
Returns
Recipient