Class JweHeader
- Since:
- 2.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the Agreement PartyUInfo header parameter for this JWE.Gets the Agreement PartyVInfo header parameter for this JWE.Gets the Algorithm set in the JWT header.Gets the Encryption Method header parameter for this JWE.Gets the Ephemeral Public Key header parameter for this JWE.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
-
Constructor Details
-
JweHeader
public JweHeader()Constructs an new, empty JweHeader. -
JweHeader
Constructs a new JweHeader with its parameters set to the contents of the given Map.- Parameters:
headerParameters
- A Map containing the parameters to be set in the header.
-
-
Method Details
-
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
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
Gets the Encryption Method header parameter for this JWE.- Returns:
- The Encryption Method.
-
setEphemeralPublicKey
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
Gets the Ephemeral Public Key header parameter for this JWE.- Returns:
- The Ephemeral Public Key.
-
setAgreementPartyUInfo
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
Gets the Agreement PartyUInfo header parameter for this JWE.- Returns:
- The Agreement PartyUInfo.
-
setAgreementPartyVInfo
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
Gets the Agreement PartyVInfo header parameter for this JWE.- Returns:
- The Agreement PartyVInfo.
-
setParameter
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
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.
-