Class GenericJsonJWE.GenericReadRecipient<A>
- Type Parameters:
A- the payload type
- All Implemented Interfaces:
JsonJWE.ReadRecipient<A>,JsonJWE.Recipient<A>
- Enclosing class:
- GenericJsonJWE<A,
B extends JsonJWE.Recipient<A>>
Generic read recipient implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.jwe.GenericJsonJWE.AbstractRecipient
header -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.inverno.mod.security.jose.internal.jwe.GenericJsonJWE.AbstractRecipient
getHeaderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.jwe.JsonJWE.Recipient
getHeader
-
Constructor Details
-
GenericReadRecipient
public GenericReadRecipient(JWEHeader header, String encryptedKey, Function<org.reactivestreams.Publisher<? extends JWK>, reactor.core.publisher.Mono<JWE<A>>> jweFactory) Creates a JSON JWE read recipient.
- Parameters:
header- the recipient specific JWE headerencryptedKey- the recipient specific Base64URL encoded encrypted keyjweFactory- the recipient JWE factory used to verify and decrypt the recipient JWE
-
-
Method Details
-
getEncryptedKey
Description copied from interface:JsonJWE.RecipientReturns the recipient specific encrypted key.
- Specified by:
getEncryptedKeyin interfaceJsonJWE.Recipient<A>- Returns:
- an encrypted key
-
readJWE
public reactor.core.publisher.Mono<JWE<A>> readJWE() throws JWEReadException, JWEBuildException, JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingExceptionDescription copied from interface:JsonJWE.ReadRecipientReturns the recipient JWE publisher.
The resulting publisher will try to resolve the JWK to use for decrypting the content encryption key based on the JWE JOSE header resulting from the merge of the protected, unprotected and recipient specific headers. It will fail if it wasn't able to find a suitable key.
- Specified by:
readJWEin interfaceJsonJWE.ReadRecipient<A>- Returns:
- a JWE publisher for decrypting and validating the recipient JWE
- Throws:
JWEReadException- if there was an error reading the recipient JWEJWEBuildException- if there was an error building the recipient JWEJOSEObjectReadException- if there was a JOSE object reading errorJOSEObjectBuildException- if there was a JOSE object building errorJOSEProcessingException- if there was a JOSE processing error
-
readJWE
public reactor.core.publisher.Mono<JWE<A>> readJWE(org.reactivestreams.Publisher<? extends JWK> keys) throws JWEReadException, JWEBuildException, JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingException Description copied from interface:JsonJWE.ReadRecipientReturns the recipient JWE publisher with the specified keys.
The resulting publisher will use the specified keys for decrypting the content encryption key, 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 JWE JOSE header resulting from the merge of the protected, unprotected and recipient specific headers.
- Specified by:
readJWEin interfaceJsonJWE.ReadRecipient<A>- Parameters:
keys- the keys to consider to decrypt the recipient content encryption key- Returns:
- a JWE publisher for decrypting and validating the recipient JWE
- Throws:
JWEReadException- if there was an error reading the recipient JWEJWEBuildException- if there was an error building the recipient JWEJOSEObjectReadException- 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 interfaceJsonJWE.Recipient<A>- Overrides:
hashCodein classGenericJsonJWE.AbstractRecipient<A>
-
equals
- Specified by:
equalsin interfaceJsonJWE.Recipient<A>- Overrides:
equalsin classGenericJsonJWE.AbstractRecipient<A>
-