JWERecipient class
The JWERecipient class presents each recipient's information and settings.
The JWERecipient class provides the following class methods.
JWERecipient.get()
Returns the recipients Unprotected Header or the value that is assigned to the named Header
Parameter in the recipients Unprotected Header or 'undefined'
.
- Syntax
JWERecipient.get([name])
- Guidelines
- If name is specified, the value of the name in the header object is returned.
JWERecipient.setKey()
Sets a key object to process the Encrypted Key that determines the CEK.
- Syntax
JWERecipient.setKey(key)
- Parameters
-
- key
- The agreed upon key to process the Encrypted Key.The key must be.
- A String object that refers to a configured object that also supports prefix usage in XSLT.
- A Buffer or Buffers object that contains the base64 encoded data of a key.
- An Object.
- An RSA public key in JWK form or symmetric key in JWK form. For JWK requirements or limitations, see jwk_js.html#jwk.isJWK.
- A JWK set. The
'kid'
and'alg'
JOSE headers are used to find a proper JWK inside the JWK set. The'kid'
header is a string that the verifier can use to find the correct key to verify the signature.