Module io.inverno.mod.security.jose
Class GenericJWEHeader
java.lang.Object
io.inverno.mod.security.jose.internal.AbstractJOSEHeader<GenericJWEHeader>
io.inverno.mod.security.jose.internal.jwe.GenericJWEHeader
- All Implemented Interfaces:
JOSEHeader,JOSEHeaderConfigurator<GenericJWEHeader>,JWEHeader,JWEHeaderConfigurator<GenericJWEHeader>
- Direct Known Subclasses:
JsonJWEHeader
public class GenericJWEHeader
extends AbstractJOSEHeader<GenericJWEHeader>
implements JWEHeader, JWEHeaderConfigurator<GenericJWEHeader>
Generic JWE header implementation.
It processed the following parameters: enc, zip, alg, jku, jwk, kid, x5u, x5c, x5t, x5t#S256, typ, cty, crit
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe encryption algorithm parameter as defined by RFC7516 Section 4.1.2.The set of parameters processed in the JWE header.protected StringThe compression algorithm parameter as defined by RFC7516 Section 4.1.3. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a generic JWE header.GenericJWEHeader(String alg, String enc) Creates a generic JWE header. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the compression algorithm.Specifies the encryption algorithm.booleanReturns the compression algorithm.Returns the encryption algorithm.Returns the parameters processed by the JOSE header.byte[]getRaw()Returns the JSON serialized JWE header raw representation.inthashCode()voidsetEncoded(String encoded) Sets the encoded header as Base64URL.voidsetExtraProcessedParameters(Set<String> extraParameters) Adds extra processed parameters which usually coming from key management and encryption algorithms.voidsetRaw(byte[] raw) Sets the JSON serialized JWE header raw representation.Methods inherited from class io.inverno.mod.security.jose.internal.AbstractJOSEHeader
addCustomParameter, algorithm, contentType, critical, getAlgorithm, getContentType, getCritical, getCustomParameters, getEncoded, getJWK, getJWKSetURL, getKey, getKeyId, getType, getX509CertificateChain, getX509CertificateSHA1Thumbprint, getX509CertificateSHA256Thumbprint, getX509CertificateURL, jwk, jwkSetURL, keyId, setKey, type, x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURLMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.JOSEHeader
getAlgorithm, getContentType, getCritical, getCustomParameters, getEncoded, getJWK, getJWKSetURL, getKey, getKeyId, getType, getX509CertificateChain, getX509CertificateSHA1Thumbprint, getX509CertificateSHA256Thumbprint, getX509CertificateURLMethods inherited from interface io.inverno.mod.security.jose.JOSEHeaderConfigurator
addCustomParameter, algorithm, contentType, critical, jwk, jwkSetURL, keyId, type, x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURL
-
Field Details
-
PROCESSED_PARAMETERS
The set of parameters processed in the JWE header. -
enc
The encryption algorithm parameter as defined by RFC7516 Section 4.1.2. -
zip
The compression algorithm parameter as defined by RFC7516 Section 4.1.3.
-
-
Constructor Details
-
GenericJWEHeader
public GenericJWEHeader()Creates a generic JWE header.
-
GenericJWEHeader
Creates a generic JWE header.
- Parameters:
alg- the key management JWA algorithmenc- the encryption JWA algorithm
-
-
Method Details
-
setExtraProcessedParameters
Adds extra processed parameters which usually coming from key management and encryption algorithms.
- Parameters:
extraParameters- a set of extra processed parameters
-
setEncoded
Description copied from class:AbstractJOSEHeaderSets the encoded header as Base64URL.
- Overrides:
setEncodedin classAbstractJOSEHeader<GenericJWEHeader>- Parameters:
encoded- the Base64URL encoded header
-
setRaw
public void setRaw(byte[] raw) Sets the JSON serialized JWE header raw representation.
- Parameters:
raw- the JSON serialized JWE header
-
getRaw
public byte[] getRaw()Returns the JSON serialized JWE header raw representation.
- Returns:
- the JSON serialized JWE header
-
getProcessedParameters
Description copied from class:AbstractJOSEHeaderReturns the parameters processed by the JOSE header.
- Overrides:
getProcessedParametersin classAbstractJOSEHeader<GenericJWEHeader>- Returns:
- a set of processed parameters
-
getEncryptionAlgorithm
Description copied from interface:JWEHeaderReturns the encryption algorithm.
.- Specified by:
getEncryptionAlgorithmin interfaceJWEHeader- Returns:
- the encryption algorithm
-
getCompressionAlgorithm
Description copied from interface:JWEHeaderReturns the compression algorithm.
- Specified by:
getCompressionAlgorithmin interfaceJWEHeader- Returns:
- the compression algorithm or null
-
encryptionAlgorithm
Description copied from interface:JWEHeaderConfiguratorSpecifies the encryption algorithm.
- Specified by:
encryptionAlgorithmin interfaceJWEHeaderConfigurator<GenericJWEHeader>- Parameters:
enc- the encryption algorithm- Returns:
- the JWE JOSE header configurator
-
compressionAlgorithm
Description copied from interface:JWEHeaderConfiguratorSpecifies the compression algorithm.
- Specified by:
compressionAlgorithmin interfaceJWEHeaderConfigurator<GenericJWEHeader>- Parameters:
zip- the compression algorithm- Returns:
- the JWE JOSE header configurator
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceJOSEHeader- Specified by:
hashCodein interfaceJWEHeader- Overrides:
hashCodein classAbstractJOSEHeader<GenericJWEHeader>
-
equals
- Specified by:
equalsin interfaceJOSEHeader- Specified by:
equalsin interfaceJWEHeader- Overrides:
equalsin classAbstractJOSEHeader<GenericJWEHeader>
-