JweHeader

@Serializable
data class JweHeader(val algorithm: JweAlgorithm?, val encryption: JweEncryption?, val keyId: String? = null, val type: String? = null, val contentType: String? = null, val jsonWebKey: JsonWebKey? = null, val jsonWebKeyUrl: String? = null, val ephemeralKeyPair: JsonWebKey? = null, val agreementPartyUInfo: ByteArray? = null, val agreementPartyVInfo: ByteArray? = null, val initializationVector: ByteArray? = null, val authenticationTag: ByteArray? = null, val certificateUrl: String? = null, val certificateChain: CertificateChain? = null, val certificateSha1Thumbprint: ByteArray? = null, val certificateSha256Thumbprint: ByteArray? = null)(source)

Header of a JweEncrypted or JweDecrypted.

See RFC 7516

Constructors

Link copied to clipboard
constructor(algorithm: JweAlgorithm?, encryption: JweEncryption?, keyId: String? = null, type: String? = null, contentType: String? = null, jsonWebKey: JsonWebKey? = null, jsonWebKeyUrl: String? = null, ephemeralKeyPair: JsonWebKey? = null, agreementPartyUInfo: ByteArray? = null, agreementPartyVInfo: ByteArray? = null, initializationVector: ByteArray? = null, authenticationTag: ByteArray? = null, certificateUrl: String? = null, certificateChain: CertificateChain? = null, certificateSha1Thumbprint: ByteArray? = null, certificateSha256Thumbprint: ByteArray? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@SerialName(value = "apu")
val agreementPartyUInfo: ByteArray? = null

RFC 7518: The "apu" (agreement PartyUInfo) value for key agreement algorithms using it (such as "ECDH-ES"), represented as a base64url-encoded string. When used, the PartyUInfo value contains information about the producer. Use of this Header Parameter is OPTIONAL. This Header Parameter MUST be understood and processed by implementations when these algorithms are used.

Link copied to clipboard
@SerialName(value = "apv")
val agreementPartyVInfo: ByteArray? = null

RFC 7518: The "apv" (agreement PartyVInfo) value for key agreement algorithms using it (such as "ECDH-ES"), represented as a base64url encoded string. When used, the PartyVInfo value contains information about the recipient. Use of this Header Parameter is OPTIONAL. This Header Parameter MUST be understood and processed by implementations when these algorithms are used.

Link copied to clipboard
@SerialName(value = "alg")
val algorithm: JweAlgorithm?

This parameter has the same meaning, syntax, and processing rules as the "alg" Header Parameter defined in Section 4.1.1 of (JWS), except that the Header Parameter identifies the cryptographic algorithm used to encrypt or determine the value of the CEK. The encrypted content is not usable if the "alg" value does not represent a supported algorithm, or if the recipient does not have a key that can be used with that algorithm.

Link copied to clipboard
@SerialName(value = "tag")
val authenticationTag: ByteArray? = null

RFC 7518: The "tag" (authentication tag) Header Parameter value is the base64url-encoded representation of the 128-bit Authentication Tag value resulting from the key encryption operation. This Header Parameter MUST be present and MUST be understood and processed by implementations when these algorithms are used.

Link copied to clipboard
@SerialName(value = "x5c")
val certificateChain: CertificateChain? = null

This parameter has the same meaning, syntax, and processing rules as the "x5c" Header Parameter defined in Section 4.1.6 of (JWS), except that the X.509 public key certificate or certificate chain (RFC5280) contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.

Link copied to clipboard
@SerialName(value = "x5t")
val certificateSha1Thumbprint: ByteArray? = null

This parameter has the same meaning, syntax, and processing rules as the "x5t" Header Parameter defined in Section 4.1.7 of (JWS), except that the certificate referenced by the thumbprint contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE. Note that certificate thumbprints are also sometimes known as certificate fingerprints.

Link copied to clipboard
@SerialName(value = "x5t#S256")
val certificateSha256Thumbprint: ByteArray? = null

This parameter has the same meaning, syntax, and processing rules as the "x5t#S256" Header Parameter defined in Section 4.1.8 of (JWS), except that the certificate referenced by the thumbprint contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE. Note that certificate thumbprints are also sometimes known as certificate fingerprints.

Link copied to clipboard
@SerialName(value = "x5u")
val certificateUrl: String? = null

This parameter has the same meaning, syntax, and processing rules as the "x5u" Header Parameter defined in Section 4.1.5 of (JWS), except that the X.509 public key certificate or certificate chain (RFC5280) contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.

Link copied to clipboard
@SerialName(value = "cty")
val contentType: String? = null

This parameter has the same meaning, syntax, and processing rules as the "cty" Header Parameter defined in Section 4.1.10 of JWS, except that the type is that of the secured content (the plaintext).

Link copied to clipboard
@SerialName(value = "enc")
val encryption: JweEncryption?

The "enc" (encryption algorithm) Header Parameter identifies the content encryption algorithm used to perform authenticated encryption on the plaintext to produce the ciphertext and the Authentication Tag. This algorithm MUST be an AEAD algorithm with a specified key length. The encrypted content is not usable if the "enc" value does not represent a supported algorithm. "enc" values should either be registered in the IANA "JSON Web Signature and Encryption Algorithms" registry established by (JWA) or be a value that contains a Collision-Resistant Name. The "enc" value is a case-sensitive ASCII string containing a StringOrURI value. This Header Parameter MUST be present and MUST be understood and processed by implementations.

Link copied to clipboard
@SerialName(value = "epk")
val ephemeralKeyPair: JsonWebKey? = null

RFC 7518: The "epk" (ephemeral public key) value created by the originator for the use in key agreement algorithms. This key is represented as a JSON Web Key (JWK) public key value. It MUST contain only public key parameters and SHOULD contain only the minimum JWK parameters necessary to represent the key; other JWK parameters included can be checked for consistency and honored, or they can be ignored. This Header Parameter MUST be present and MUST be understood and processed by implementations when these algorithms are used.

Link copied to clipboard
@SerialName(value = "iv")
val initializationVector: ByteArray? = null

RFC 7518: The "iv" (initialization vector) Header Parameter value is the base64url-encoded representation of the 96-bit IV value used for the key encryption operation. This Header Parameter MUST be present and MUST be understood and processed by implementations when these algorithms are used.

Link copied to clipboard
@SerialName(value = "jwk")
val jsonWebKey: JsonWebKey? = null

This parameter has the same meaning, syntax, and processing rules as the "jwk" Header Parameter defined in Section 4.1.3 of JWS, except that the key is the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.

Link copied to clipboard
@SerialName(value = "jku")
val jsonWebKeyUrl: String? = null

This parameter has the same meaning, syntax, and processing rules as the "jku" Header Parameter defined in Section 4.1.2 of JWS, except that the JWK Set resource contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.

Link copied to clipboard
@SerialName(value = "kid")
val keyId: String? = null

This parameter has the same meaning, syntax, and processing rules as the "kid" Header Parameter defined in Section 4.1.4 of (JWS), except that the key hint references the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE. This parameter allows originators to explicitly signal a change of key to JWE recipients.

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "typ")
val type: String? = null

This parameter has the same meaning, syntax, and processing rules as the "typ" Header Parameter defined in Section 4.1.9 of (JWS), except that the type is that of this complete JWE.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard