Package io.jans.as.model.jwt
Class JwtHeader
java.lang.Object
io.jans.as.model.jwt.JwtClaimSet
io.jans.as.model.jwt.JwtHeader
- Version:
- September 30, 2021
- Author:
- Javier Rojas Blum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObject
getJwk()
getKeyId()
getType()
static JwtHeader
instance()
void
setAgreementPartyUInfo
(String agreementPartyUInfo) The "apu" (agreement PartyUInfo) value for key agreement algorithms using it (such as "ECDH-ES"), represented as a base64url encoded string.void
setAgreementPartyVInfo
(String agreementPartyVInfo) The "apv" (agreement PartyVInfo) value for key agreement algorithms using it (such as "ECDH-ES"), represented as a base64url encoded string.setAlgorithm
(KeyEncryptionAlgorithm algorithm) Identifies the cryptographic algorithm used to encrypt the JWE.setAlgorithm
(SignatureAlgorithm algorithm) Identifies the cryptographic algorithm used to secure the JWS.void
setCompressionAlgorithm
(String compressionAlgorithm) The "zip" (compression algorithm) applied to the Plaintext before encryption, if any.void
setContentType
(JwtType contentType) In a JWS it is used to declare the type of the secured content (the Payload).void
setEncryptionMethod
(BlockEncryptionAlgorithm encryptionMethod) Identifies the block encryption algorithm used to encrypt the Plaintext to produce the Cipher Text.void
setEncryptionPartyUInfo
(String encryptionPartyUInfo) The "epu" (encryption PartyUInfo) value for plaintext encryption algorithms using it (such as "A128CBC+HS256"), represented as a base64url encoded string.void
setEncryptionPartyVInfo
(String encryptionPartyVInfo) The "epv" (encryption PartyVInfo) value for plaintext encryption algorithms using it (such as "A128CBC+HS256"), represented as a base64url encoded string.void
setEphemeralPublicKey
(String ephemeralPublicKey) Value created by the originator for the use in key agreement algorithms.setJwk
(org.json.JSONObject jwk) Indicates which key was used to secure/encrypt the JWS/JWE.Declares the type of this object.Methods inherited from class io.jans.as.model.jwt.JwtClaimSet
getClaim, getClaimAsCharacter, getClaimAsDate, getClaimAsInteger, getClaimAsJSON, getClaimAsLong, getClaimAsString, getClaimAsStringList, hasClaim, keys, load, load, removeClaim, setClaim, setClaim, setClaim, setClaim, setClaim, setClaim, setClaim, setClaim, setClaim, setClaim, setClaimFromJsonObject, setClaimObject, setNullClaim, toBase64JsonObject, toJsonObject, toJsonString, toMap
-
Constructor Details
-
JwtHeader
public JwtHeader() -
JwtHeader
public JwtHeader(org.json.JSONObject jsonObject) -
JwtHeader
- Throws:
InvalidJwtException
-
-
Method Details
-
instance
-
setType
Declares the type of this object.- Parameters:
type
- The type of this object.
-
getType
-
getSignatureAlgorithm
-
setAlgorithm
Identifies the cryptographic algorithm used to secure the JWS.- Parameters:
algorithm
- The cryptographic algorithm.
-
setAlgorithm
Identifies the cryptographic algorithm used to encrypt the JWE.- Parameters:
algorithm
- The cryptographic algorithm.
-
getKeyId
-
setKeyId
Indicates which key was used to secure/encrypt the JWS/JWE.- Parameters:
keyId
- The key id.
-
getJwk
public org.json.JSONObject getJwk() -
setJwk
-
setContentType
In a JWS it is used to declare the type of the secured content (the Payload). In a JWE it is used to declare the type of the encrypted content (the Plaintext).- Parameters:
contentType
- The content type.
-
getContentType
-
setEncryptionMethod
Identifies the block encryption algorithm used to encrypt the Plaintext to produce the Cipher Text.- Parameters:
encryptionMethod
- The JWE Encryption Method
-
getEncryptionMethod
-
setEphemeralPublicKey
Value created by the originator for the use in key agreement algorithms.- Parameters:
ephemeralPublicKey
- The Ephemeral Public Key.
-
setCompressionAlgorithm
The "zip" (compression algorithm) applied to the Plaintext before encryption, if any. If present, the value of the "zip" header parameter MUST be the case sensitive string "DEF". Compression is performed with the DEFLATE algorithm.- Parameters:
compressionAlgorithm
- The compression algorithm.
-
setAgreementPartyUInfo
The "apu" (agreement PartyUInfo) value for key agreement algorithms using it (such as "ECDH-ES"), represented as a base64url encoded string.- Parameters:
agreementPartyUInfo
- The Agreement PartyUInfo.
-
setAgreementPartyVInfo
The "apv" (agreement PartyVInfo) value for key agreement algorithms using it (such as "ECDH-ES"), represented as a base64url encoded string.- Parameters:
agreementPartyVInfo
- The Agreement PartyVInfo.
-
setEncryptionPartyUInfo
The "epu" (encryption PartyUInfo) value for plaintext encryption algorithms using it (such as "A128CBC+HS256"), represented as a base64url encoded string.- Parameters:
encryptionPartyUInfo
- The Encryption PartyUInfo.
-
setEncryptionPartyVInfo
The "epv" (encryption PartyVInfo) value for plaintext encryption algorithms using it (such as "A128CBC+HS256"), represented as a base64url encoded string.- Parameters:
encryptionPartyVInfo
- The Encryption PartyVInfo.
-