Module io.inverno.mod.security.jose
Class GenericJsonJWS<A,B extends JsonJWS.Signature<A>>
java.lang.Object
io.inverno.mod.security.jose.internal.AbstractJsonJOSEObject<A>
io.inverno.mod.security.jose.internal.jws.GenericJsonJWS<A,B>
- Type Parameters:
A- the payload typeB- the JSON JWS signature type
- All Implemented Interfaces:
JsonJOSEObject<A>,JsonJWS<A,B>
public class GenericJsonJWS<A,B extends JsonJWS.Signature<A>>
extends AbstractJsonJOSEObject<A>
implements JsonJWS<A,B>
Generic JSON JWS implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBaseJsonJWS.Signatureimplementation.static classGeneric built signature implementation.static classGeneric read signature implementation.Nested classes/interfaces inherited from interface io.inverno.mod.security.jose.jws.JsonJWS
JsonJWS.BuiltSignature<A>, JsonJWS.ReadSignature<A>, JsonJWS.Signature<A> -
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.AbstractJsonJOSEObject
mapper -
Constructor Summary
ConstructorsConstructorDescriptionGenericJsonJWS(com.fasterxml.jackson.databind.ObjectMapper mapper, GenericJWSPayload<A> payload, List<B> signatures) Creates a generic JSON JWS. -
Method Summary
-
Constructor Details
-
GenericJsonJWS
public GenericJsonJWS(com.fasterxml.jackson.databind.ObjectMapper mapper, GenericJWSPayload<A> payload, List<B> signatures) Creates a generic JSON JWS.
- Parameters:
mapper- an object mapperpayload- the JSON JWS payloadsignatures- a list of JSON JWS signatures
-
-
Method Details
-
getPayload
Description copied from interface:JsonJWSReturns the payload.
- Specified by:
getPayloadin interfaceJsonJWS<A,B extends JsonJWS.Signature<A>> - Returns:
- the payload
-
getEncodedPayload
Returns the payload encoded as Base64URL.
- Returns:
- the Base64URL encoded payload
-
getSignatures
Description copied from interface:JsonJWSReturns the list of signatures.
When considering a built JSON JWS, signatures must be of type
JsonJWS.BuiltSignaturewhich directly exposes the built JWS objects corresponding to each signature.When considering a read JSON JWS, signatures must be of type
JsonJWS.ReadSignaturewhich exposes JWS objects per recipient as single publisher used to validate the corresponding JWS.- Specified by:
getSignaturesin interfaceJsonJWS<A,B extends JsonJWS.Signature<A>> - Returns:
- a list of signatures
-
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>
-