Module io.inverno.mod.security.jose
Class GenericJWE<A>
java.lang.Object
io.inverno.mod.security.jose.internal.AbstractJOSEObject<A,JWEHeader,GenericJWEPayload<A>>
io.inverno.mod.security.jose.internal.jwe.GenericJWE<A>
- Type Parameters:
A- the payload type
- All Implemented Interfaces:
JOSEObject<A,,JWEHeader> JWE<A>
public class GenericJWE<A>
extends AbstractJOSEObject<A,JWEHeader,GenericJWEPayload<A>>
implements JWE<A>
Generic JSON Web Encryption implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.AbstractJOSEObject
header, payload -
Constructor Summary
ConstructorsConstructorDescriptionGenericJWE(GenericJWEHeader header, GenericJWEPayload<A> payload, String initializationVector, String authenticationTag) Creates a generic JWE.GenericJWE(GenericJWEHeader header, GenericJWEPayload<A> payload, String initializationVector, String authenticationTag, String encryptedKey, JWK cek) Creates a generic JWE with encrypted key and corresponding content encryption key. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the authentication tag encoded as Base64URL.Returns the cipher text encoded as Base64URL.Returns the encrypted key encoded as Base64URL.Returns the initialization vector encoded as Base64URL.inthashCode()Serializes the JOSE object to a compact representation.Methods inherited from class io.inverno.mod.security.jose.internal.AbstractJOSEObject
getHeader, getPayloadMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.JOSEObject
getHeader, getPayload
-
Constructor Details
-
GenericJWE
public GenericJWE(GenericJWEHeader header, GenericJWEPayload<A> payload, String initializationVector, String authenticationTag) Creates a generic JWE.
- Parameters:
header- the JWE headerpayload- the JWE payloadinitializationVector- the Base64URL encoded initialization vector without paddingauthenticationTag- the Base64URL encoded authentication tag without padding
-
GenericJWE
public GenericJWE(GenericJWEHeader header, GenericJWEPayload<A> payload, String initializationVector, String authenticationTag, String encryptedKey, JWK cek) Creates a generic JWE with encrypted key and corresponding content encryption key.
- Parameters:
header- the JWE headerpayload- the JWE payloadinitializationVector- the Base64URL encoded initialization vector without paddingauthenticationTag- the Base64URL encoded authentication tag without paddingencryptedKey- the encrypted keycek- the corresponding CEK
-
-
Method Details
-
getEncryptedKey
Description copied from interface:JWEReturns the encrypted key encoded as Base64URL.
- Specified by:
getEncryptedKeyin interfaceJWE<A>- Returns:
- the Base64URL encoded encrypted key with no padding
-
getInitializationVector
Description copied from interface:JWEReturns the initialization vector encoded as Base64URL.
- Specified by:
getInitializationVectorin interfaceJWE<A>- Returns:
- the Base64URL encoded initialization vector with no padding
-
getCipherText
Description copied from interface:JWEReturns the cipher text encoded as Base64URL.
- Specified by:
getCipherTextin interfaceJWE<A>- Returns:
- the Base64URL encoded cipher text with no padding
-
getAuthenticationTag
Description copied from interface:JWEReturns the authentication tag encoded as Base64URL.
- Specified by:
getAuthenticationTagin interfaceJWE<A>- Returns:
- the Base64URL encoded authentication tag with no padding
-
toCompact
Description copied from interface:JOSEObjectSerializes the JOSE object to a compact representation.
- Specified by:
toCompactin interfaceJOSEObject<A,JWEHeader> - Returns:
- the compact representation of the JOSE object
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceJOSEObject<A,JWEHeader> - Specified by:
hashCodein interfaceJWE<A>- Overrides:
hashCodein classAbstractJOSEObject<A,JWEHeader, GenericJWEPayload<A>>
-
equals
- Specified by:
equalsin interfaceJOSEObject<A,JWEHeader> - Specified by:
equalsin interfaceJWE<A>- Overrides:
equalsin classAbstractJOSEObject<A,JWEHeader, GenericJWEPayload<A>>
-