Package com.nimbusds.jose
Class JWEObjectJSON.Recipient
- java.lang.Object
-
- com.nimbusds.jose.JWEObjectJSON.Recipient
-
- Enclosing class:
- JWEObjectJSON
@Immutable public static final class JWEObjectJSON.Recipient extends Object
Individual recipient in a JWE object serialisable to JSON.
-
-
Constructor Summary
Constructors Constructor Description Recipient(UnprotectedHeader unprotectedHeader, Base64URL encryptedKey)
Creates a new parsed recipient.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Base64URL
getEncryptedKey()
Returns the encrypted key.UnprotectedHeader
getUnprotectedHeader()
Returns the per-recipient unprotected header.static JWEObjectJSON.Recipient
parse(Map<String,Object> jsonObject)
Parses a recipients object from the specified JSON object.Map<String,Object>
toJSONObject()
Returns a JSON object representation for use in the general and flattened serialisations.
-
-
-
Constructor Detail
-
Recipient
public Recipient(UnprotectedHeader unprotectedHeader, Base64URL encryptedKey)
Creates a new parsed recipient.- Parameters:
unprotectedHeader
- The per-recipient unprotected header,null
if none.encryptedKey
- The encrypted key,null
if none.
-
-
Method Detail
-
getUnprotectedHeader
public UnprotectedHeader getUnprotectedHeader()
Returns the per-recipient unprotected header.- Returns:
- The per-recipient unprotected header,
null
if none.
-
getEncryptedKey
public Base64URL getEncryptedKey()
Returns the encrypted key.- Returns:
- The encryptedKey.
-
toJSONObject
public Map<String,Object> toJSONObject()
Returns a JSON object representation for use in the general and flattened serialisations.- Returns:
- The JSON object.
-
parse
public static JWEObjectJSON.Recipient parse(Map<String,Object> jsonObject) throws ParseException
Parses a recipients object from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The recipient object.
- Throws:
ParseException
- If the string couldn't be parsed to a JWE object.
-
-