Class JweHeader
- java.lang.Object
-
- org.forgerock.json.jose.jwt.JWObject
-
- org.forgerock.json.jose.jwt.JwtHeader
-
- org.forgerock.json.jose.jws.JwtSecureHeader
-
- org.forgerock.json.jose.jwe.JweHeader
-
public class JweHeader extends JwtSecureHeader
An implementation for the JWE Header parameters.- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAgreementPartyUInfo()
Gets the Agreement PartyUInfo header parameter for this JWE.String
getAgreementPartyVInfo()
Gets the Agreement PartyVInfo header parameter for this JWE.JweAlgorithm
getAlgorithm()
Gets the Algorithm set in the JWT header.EncryptionMethod
getEncryptionMethod()
Gets the Encryption Method header parameter for this JWE.JWK
getEphemeralPublicKey()
Gets the Ephemeral Public Key header parameter for this JWE.Object
getParameter(String key)
Gets a header parameter for the specified key.void
setAgreementPartyUInfo(String agreementPartyUInfo)
Sets the Agreement PartyUInfo header parameter for this JWE.void
setAgreementPartyVInfo(String agreementPartyVInfo)
Sets the Agreement PartyVInfo header parameter for this JWE.void
setEncryptionMethod(EncryptionMethod encryptionMethod)
Sets the Encryption Method header parameter for this JWE.void
setEphemeralPublicKey(JWK ephemeralPublicKey)
Sets the Ephemeral Public Key header parameter for this JWE.void
setParameter(String key, Object value)
Sets a header parameter with the specified key and value.-
Methods inherited from class org.forgerock.json.jose.jws.JwtSecureHeader
getCompressionAlgorithm, getContentType, getCriticalHeaders, getJsonWebKey, getJwkSetUrl, getKeyId, getX509CertificateChain, getX509CertificateThumbprint, getX509Url, setCompressionAlgorithm, setContentType, setCriticalHeaders, setJsonWebKey, setJwkSetUrl, setKeyId, setX509CertificateChain, setX509CertificateThumbprint, setX509Url
-
Methods inherited from class org.forgerock.json.jose.jwt.JwtHeader
build, getAlgorithmString, getParameter, getParameters, getType, setAlgorithm, setParameters, setType
-
Methods inherited from class org.forgerock.json.jose.jwt.JWObject
checkListValuesAreOfType, checkValueIsOfType, equals, get, hashCode, isDefined, isValueOfType, keys, put, toJsonValue, toString
-
-
-
-
Method Detail
-
getAlgorithm
public JweAlgorithm getAlgorithm()
Gets the Algorithm set in the JWT header.If there is no algorithm set in the JWT header, then the JweAlgorithm NONE will be returned.
- Specified by:
getAlgorithm
in classJwtHeader
- Returns:
- The Algorithm.
-
setEncryptionMethod
public void setEncryptionMethod(EncryptionMethod encryptionMethod)
Sets the Encryption Method header parameter for this JWE.Identifies the block encryption algorithm used to encrypt the Plaintext to produce the Ciphertext.
- Parameters:
encryptionMethod
- The Encryption Method.
-
getEncryptionMethod
public EncryptionMethod getEncryptionMethod()
Gets the Encryption Method header parameter for this JWE.- Returns:
- The Encryption Method.
-
setEphemeralPublicKey
public void setEphemeralPublicKey(JWK ephemeralPublicKey)
Sets the Ephemeral Public Key header parameter for this JWE.For use in key agreement algorithms. When the Algorithm header parameter value specified identifies an algorithm for which "epk" is a parameter, this parameter MUST be present if REQUIRED by the algorithm.
- Parameters:
ephemeralPublicKey
- The Ephemeral Public Key.
-
getEphemeralPublicKey
public JWK getEphemeralPublicKey()
Gets the Ephemeral Public Key header parameter for this JWE.- Returns:
- The Ephemeral Public Key.
-
setAgreementPartyUInfo
public void setAgreementPartyUInfo(String agreementPartyUInfo)
Sets the Agreement PartyUInfo header parameter for this JWE.For use with key agreement algorithms (such as "ECDH-ES"), represented as a base64url encoded string.
- Parameters:
agreementPartyUInfo
- The Agreement PartyUInfo.
-
getAgreementPartyUInfo
public String getAgreementPartyUInfo()
Gets the Agreement PartyUInfo header parameter for this JWE.- Returns:
- The Agreement PartyUInfo.
-
setAgreementPartyVInfo
public void setAgreementPartyVInfo(String agreementPartyVInfo)
Sets the Agreement PartyVInfo header parameter for this JWE.For use with key agreement algorithms (such as "ECDH-ES"), represented as a base64url encoded string.
- Parameters:
agreementPartyVInfo
- The Agreement PartyVInfo.
-
getAgreementPartyVInfo
public String getAgreementPartyVInfo()
Gets the Agreement PartyVInfo header parameter for this JWE.- Returns:
- The Agreement PartyVInfo.
-
setParameter
public void setParameter(String key, Object value)
Description copied from class:JwtSecureHeader
Sets a header parameter with the specified key and value.If the key matches one of the reserved header parameter names, then the relevant
set
method is called to set that header parameter with the specified value.- Overrides:
setParameter
in classJwtSecureHeader
- Parameters:
key
- The key of the header parameter.value
- The value of the header parameter.
-
getParameter
public Object getParameter(String key)
Description copied from class:JwtSecureHeader
Gets a header parameter for the specified key.If the key matches one of the reserved header parameter names, then the relevant
get
method is called to get that header parameter.- Overrides:
getParameter
in classJwtSecureHeader
- Parameters:
key
- The header parameter key.- Returns:
- The value stored against the header parameter key.
-
-