Package io.jans.as.model.jwt
Class JwtHeader
- java.lang.Object
-
- io.jans.as.model.jwt.JwtClaimSet
-
- io.jans.as.model.jwt.JwtHeader
-
public class JwtHeader extends JwtClaimSet
- Version:
- September 30, 2021
- Author:
- Javier Rojas Blum
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JwtType
getContentType()
BlockEncryptionAlgorithm
getEncryptionMethod()
org.json.JSONObject
getJwk()
String
getKeyId()
SignatureAlgorithm
getSignatureAlgorithm()
JwtType
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.JwtHeader
setAlgorithm(KeyEncryptionAlgorithm algorithm)
Identifies the cryptographic algorithm used to encrypt the JWE.JwtHeader
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.JwtHeader
setJwk(org.json.JSONObject jwk)
JwtHeader
setKeyId(String keyId)
Indicates which key was used to secure/encrypt the JWS/JWE.JwtHeader
setType(JwtType type)
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 Detail
-
JwtHeader
public JwtHeader()
-
JwtHeader
public JwtHeader(org.json.JSONObject jsonObject)
-
JwtHeader
public JwtHeader(String base64JsonObject) throws InvalidJwtException
- Throws:
InvalidJwtException
-
-
Method Detail
-
instance
public static JwtHeader instance()
-
setType
public JwtHeader setType(JwtType type)
Declares the type of this object.- Parameters:
type
- The type of this object.
-
getType
public JwtType getType()
-
getSignatureAlgorithm
public SignatureAlgorithm getSignatureAlgorithm()
-
setAlgorithm
public JwtHeader setAlgorithm(SignatureAlgorithm algorithm)
Identifies the cryptographic algorithm used to secure the JWS.- Parameters:
algorithm
- The cryptographic algorithm.
-
setAlgorithm
public JwtHeader setAlgorithm(KeyEncryptionAlgorithm algorithm)
Identifies the cryptographic algorithm used to encrypt the JWE.- Parameters:
algorithm
- The cryptographic algorithm.
-
getKeyId
public String getKeyId()
-
setKeyId
public JwtHeader setKeyId(String keyId)
Indicates which key was used to secure/encrypt the JWS/JWE.- Parameters:
keyId
- The key id.
-
getJwk
public org.json.JSONObject getJwk()
-
setJwk
public JwtHeader setJwk(org.json.JSONObject jwk)
-
setContentType
public void setContentType(JwtType contentType)
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
public JwtType getContentType()
-
setEncryptionMethod
public void setEncryptionMethod(BlockEncryptionAlgorithm encryptionMethod)
Identifies the block encryption algorithm used to encrypt the Plaintext to produce the Cipher Text.- Parameters:
encryptionMethod
- The JWE Encryption Method
-
getEncryptionMethod
public BlockEncryptionAlgorithm getEncryptionMethod()
-
setEphemeralPublicKey
public void setEphemeralPublicKey(String ephemeralPublicKey)
Value created by the originator for the use in key agreement algorithms.- Parameters:
ephemeralPublicKey
- The Ephemeral Public Key.
-
setCompressionAlgorithm
public void setCompressionAlgorithm(String compressionAlgorithm)
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
public 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.- Parameters:
agreementPartyUInfo
- The Agreement PartyUInfo.
-
setAgreementPartyVInfo
public 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.- Parameters:
agreementPartyVInfo
- The Agreement PartyVInfo.
-
setEncryptionPartyUInfo
public 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.- Parameters:
encryptionPartyUInfo
- The Encryption PartyUInfo.
-
setEncryptionPartyVInfo
public 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.- Parameters:
encryptionPartyVInfo
- The Encryption PartyVInfo.
-
-