Module io.inverno.mod.security.jose
Class RecipientJWEReader<A>
java.lang.Object
io.inverno.mod.security.jose.internal.AbstractJOSEObjectReader<A,JWEHeader,JWE<A>,GenericJWEReader<A>>
io.inverno.mod.security.jose.internal.jwe.GenericJWEReader<A>
io.inverno.mod.security.jose.internal.jwe.RecipientJWEReader<A>
- Type Parameters:
A- the expected payload type
- All Implemented Interfaces:
JOSEObjectReader<A,,JWEHeader, JWE<A>, GenericJWEReader<A>> JWEReader<A,GenericJWEReader<A>>
JSON JWE recipient specific JWE reader used to read recipient specific JWE when reading a JSON JWE.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.AbstractJOSEObjectReader
applicationProcessedParameters, dataConversionService, jwkService, keys, mapper, type -
Constructor Summary
ConstructorsConstructorDescriptionRecipientJWEReader(com.fasterxml.jackson.databind.ObjectMapper mapper, io.inverno.mod.security.jose.internal.converter.DataConversionService dataConversionService, JWKService jwkService, Type type, org.reactivestreams.Publisher<? extends JWK> keys, List<JWEZip> zips, GenericJWEHeader jweHeader, byte[] aad) Creates a JSON JWE recipient reader. -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]getAdditionalAuthenticationData(GenericJWEHeader jweHeader) Returns expected additional authentication data.protected GenericJWEHeaderreadJWEHeader(String encodedHeader) Reads the JWE header.Methods inherited from class io.inverno.mod.security.jose.internal.jwe.GenericJWEReader
checkHeader, getPayloadZip, read, readMethods inherited from class io.inverno.mod.security.jose.internal.AbstractJOSEObjectReader
checkCriticalParameters, getKeys, getPayloadDecoder, getProcessedParameters, processedParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.JOSEObjectReader
processedParameters, read
-
Constructor Details
-
RecipientJWEReader
public RecipientJWEReader(com.fasterxml.jackson.databind.ObjectMapper mapper, io.inverno.mod.security.jose.internal.converter.DataConversionService dataConversionService, JWKService jwkService, Type type, org.reactivestreams.Publisher<? extends JWK> keys, List<JWEZip> zips, GenericJWEHeader jweHeader, byte[] aad) Creates a JSON JWE recipient reader.
- Parameters:
mapper- an object mapperdataConversionService- a data conversion servicejwkService- a JWK servicetype- a payload typekeys- the recipient specific keys to consider to decrypt the CEKzips- a list of supported JWE compression algorithmsjweHeader- the recipient JWE headeraad- the additional authentication data
-
-
Method Details
-
readJWEHeader
protected GenericJWEHeader readJWEHeader(String encodedHeader) throws JWEReadException, JOSEObjectReadException, JOSEProcessingException Description copied from class:GenericJWEReaderReads the JWE header.
- Overrides:
readJWEHeaderin classGenericJWEReader<A>- Parameters:
encodedHeader- the Base64URL encoded JWE header- Returns:
- the JWE header
- Throws:
JWEReadException- if there was an error reading the JWE headerJOSEObjectReadException- if there was an error reading the JWE headerJOSEProcessingException- if there was a JOSE processing error
-
getAdditionalAuthenticationData
Description copied from class:GenericJWEReaderReturns expected additional authentication data.
For a compact JWE it should be
ASCII(Encoded Protected Header). For a JSON JWE it should beASCII(Encoded Protected Header || '.' || BASE64URL(JWE AAD)).- Overrides:
getAdditionalAuthenticationDatain classGenericJWEReader<A>- Parameters:
jweHeader- the JWE header- Returns:
- the additional authentication data
-