Back to Jose

Interface: Recipient

docs/jwe/general/encrypt/interfaces/Recipient.md

6.2.22.7 KB
Original Source

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(...args): Recipient

A shorthand for calling addRecipient() on the enclosing GeneralEncrypt instance

Parameters

ParameterType
...args[Uint8Array | CryptoKey | JWK | KeyObject, CritOption]

Returns

Recipient


done()

ā–ø done(): GeneralEncrypt

Returns the enclosing GeneralEncrypt instance

Returns

GeneralEncrypt


encrypt()

ā–ø encrypt(...args): Promise<GeneralJWE>

A shorthand for calling encrypt() on the enclosing GeneralEncrypt instance

Parameters

ParameterType
...args[]

Returns

Promise<GeneralJWE>


setKeyManagementParameters()

ā–ø setKeyManagementParameters(parameters): Recipient

Sets the JWE Key Management parameters to be used when encrypting.

(ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement PartyUInfo) or "apv" (Agreement PartyVInfo) parameters.

Parameters

ParameterTypeDescription
parametersJWEKeyManagementHeaderParametersJWE Key Management parameters.

Returns

Recipient


setUnprotectedHeader()

ā–ø setUnprotectedHeader(unprotectedHeader): Recipient

Sets the JWE Per-Recipient Unprotected Header on the Recipient object.

Parameters

ParameterTypeDescription
unprotectedHeaderJWEHeaderParametersJWE Per-Recipient Unprotected Header.

Returns

Recipient