Class GenericJsonJWS.GenericReadSignature<A>
- Type Parameters:
A- the payload type
- All Implemented Interfaces:
JsonJWS.ReadSignature<A>,JsonJWS.Signature<A>
- Enclosing class:
- GenericJsonJWS<A,
B extends JsonJWS.Signature<A>>
Generic read signature implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.jws.GenericJsonJWS.AbstractSignature
protectedHeader, unprotectedHeader -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.inverno.mod.security.jose.internal.jws.GenericJsonJWS.AbstractSignature
getEncodedProtectedHeader, getProtectedHeader, getUnprotectedHeaderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.jws.JsonJWS.Signature
getProtectedHeader, getUnprotectedHeader
-
Constructor Details
-
GenericReadSignature
public GenericReadSignature(JWSHeader protectedHeader, JWSHeader unprotectedHeader, String signature, Function<org.reactivestreams.Publisher<? extends JWK>, reactor.core.publisher.Mono<JWS<A>>> jwsFactory) Creates a JSON JWS read signature.
- Parameters:
protectedHeader- the signature specific protected JWS headerunprotectedHeader- the signature specific unprotected JWS headersignature- the signature specific Base64URL encoded signature without paddingjwsFactory- the signature JWS factory used to verify signature JWS
-
-
Method Details
-
getSignature
Description copied from interface:JsonJWS.SignatureReturns the signature encoded as Base64URL.
- Specified by:
getSignaturein interfaceJsonJWS.Signature<A>- Returns:
- the Base64URL encoded signature with no padding
-
readJWS
public reactor.core.publisher.Mono<JWS<A>> readJWS() throws JWSReadException, JWSBuildException, JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingExceptionDescription copied from interface:JsonJWS.ReadSignatureReturns the signature JWS publisher.
The resulting publisher will try to resolve the JWK to use for validating the signature based on the JWS JOSE header resulting from the merge of the protected and unprotected headers. It will fail if it wasn't able to find a suitable key.
- Specified by:
readJWSin interfaceJsonJWS.ReadSignature<A>- Returns:
- a JWS publisher for validating the recipient JWS
- Throws:
JWSReadException- if there was an error reading the recipient JWSJWSBuildException- if there was an error building the recipient JWSJOSEObjectReadException- if there was a JOSE object reading errorJOSEObjectBuildException- if there was a JOSE object building errorJOSEProcessingException- if there was a JOSE processing error
-
readJWS
public reactor.core.publisher.Mono<JWS<A>> readJWS(org.reactivestreams.Publisher<? extends JWK> keys) throws JWSReadException, JWSBuildException, JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingException Description copied from interface:JsonJWS.ReadSignatureReturns the signature JWS publisher with the specified keys.
The resulting publisher will use the specified keys for validating the signature, the first succeeding key will be retained and remaining keys will be ignored. It will fail if no suitable key have been specified or if they are not consistent with the JWS JOSE header resulting from the merge of the protected and unprotected headers.
- Specified by:
readJWSin interfaceJsonJWS.ReadSignature<A>- Parameters:
keys- the keys to consider to decrypt the recipient content encryption key- Returns:
- a JWS publisher for validating the recipient JWS
- Throws:
JWSReadException- if there was an error reading the recipient JWSJWSBuildException- if there was an error building the recipient JWSJOSEObjectReadException- if there was a JOSE object reading errorJOSEObjectBuildException- if there was a JOSE object building errorJOSEProcessingException- if there was a JOSE processing error
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceJsonJWS.Signature<A>- Overrides:
hashCodein classGenericJsonJWS.AbstractSignature<A>
-
equals
- Specified by:
equalsin interfaceJsonJWS.Signature<A>- Overrides:
equalsin classGenericJsonJWS.AbstractSignature<A>
-