Class GenericJsonJWE<A,B extends JsonJWE.Recipient<A>>
- Type Parameters:
A- the payload typeB- the JSON JWE recipient type
- All Implemented Interfaces:
JsonJOSEObject<A>,JsonJWE<A,B>
Generic JSON JWE implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBaseJsonJWE.Recipientimplementation.static classGeneric built recipient implementation.static classGeneric read recipient implementation.Nested classes/interfaces inherited from interface io.inverno.mod.security.jose.jwe.JsonJWE
JsonJWE.BuiltRecipient<A>, JsonJWE.ReadRecipient<A>, JsonJWE.Recipient<A> -
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.AbstractJsonJOSEObject
mapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the additional authentication data common to all recipients encoded as Base64URL.Returns the authentication tag common to all recipients encoded as Base64URL.Returns the cipher text common to all recipients encoded as Base64URL.Returns the protected JWE header encoded as Base64URL.Returns the initialization vector common to all recipients encoded as Base64URL.Returns the protected header common to all recipients.Returns the list of recipients.Returns the unprotected header common to all recipients.inthashCode()toJson()Serializes the JOSE object to a JSON representation.
-
Constructor Details
-
GenericJsonJWE
public GenericJsonJWE(JWEHeader protectedHeader, JWEHeader unprotectedHeader, String iv, String aad, String cipherText, String tag, List<B> recipients, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a generic JSON JWE.
- Parameters:
protectedHeader- the protected headerunprotectedHeader- the unprotected headeriv- the Base64URL encoded initialization vector without paddingaad- the Base64URL encoded additional authentication data without paddingcipherText- the Base64URL encoded cipher text without paddingtag- the Base64URL encoded authenticationt tag without paddingrecipients- the list of JSON JWE recipientsmapper- an object mapper
-
-
Method Details
-
getProtectedHeader
Description copied from interface:JsonJWEReturns the protected header common to all recipients.
- Specified by:
getProtectedHeaderin interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- the protected header
-
getEncodedProtectedHeader
Returns the protected JWE header encoded as Base64URL.
- Returns:
- the Base64URL encoded protected JWE header.
-
getUnprotectedHeader
Description copied from interface:JsonJWEReturns the unprotected header common to all recipients.
- Specified by:
getUnprotectedHeaderin interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- the unprotected header
-
getInitializationVector
Description copied from interface:JsonJWEReturns the initialization vector common to all recipients encoded as Base64URL.
- Specified by:
getInitializationVectorin interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- the Base64URL encoded initialization vector with no padding
-
getAdditionalAuthenticationData
Description copied from interface:JsonJWEReturns the additional authentication data common to all recipients encoded as Base64URL.
- Specified by:
getAdditionalAuthenticationDatain interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- the Base64URL encoded additional authentication data with no padding
-
getCipherText
Description copied from interface:JsonJWEReturns the cipher text common to all recipients encoded as Base64URL.
- Specified by:
getCipherTextin interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- the Base64URL encoded cipher text with no padding
-
getAuthenticationTag
Description copied from interface:JsonJWEReturns the authentication tag common to all recipients encoded as Base64URL.
- Specified by:
getAuthenticationTagin interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- the Base64URL encoded authentication tag with no padding
-
getRecipients
Description copied from interface:JsonJWEReturns the list of recipients.
When considering a built JSON JWE, recipient must be of type
JsonJWE.BuiltRecipientwhich directly exposes the built JWE objects corresponding to recipient.When considering a read JSON JWE, recipient must be of type
JsonJWE.ReadRecipientwhich exposes JWE objects per recipient as single publisher used to decrypt and validate the corresponding JWE.- Specified by:
getRecipientsin interfaceJsonJWE<A,B extends JsonJWE.Recipient<A>> - Returns:
- a list of recipients
-
toJson
Description copied from interface:JsonJOSEObjectSerializes the JOSE object to a JSON representation.
- Specified by:
toJsonin interfaceJsonJOSEObject<A>- Overrides:
toJsonin classAbstractJsonJOSEObject<A>- Returns:
- the JSON representation of the JOSE object
- Throws:
JOSEProcessingException- if there was an error serializing the JOSE object
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractJsonJOSEObject<A>
-
equals
- Overrides:
equalsin classAbstractJsonJOSEObject<A>
-