JSON Web Encryption (JWE) Header Parameters

The Header Parameter names for use in JWEs are registered in the IANA "JSON Web Signature and Encryption Header Parameters" registry.

interface JweHeaderParams {
    alg: string;
    apu?: Uint8Array;
    apv?: Uint8Array;
    crit?: string[];
    cty?: string;
    enc: string;
    epk?: Uint8Array;
    iv?: Uint8Array;
    jku?: string;
    jwk?: Jwk;
    kid?: string;
    p2c?: number;
    p2s?: string;
    tag?: Uint8Array;
    typ?: string;
    x5c?: string[];
    x5t?: string;
    x5u?: string;
    [key: string]: unknown;
}

Hierarchy (view full)

Indexable

[key: string]: unknown

Additional Public or Private Header Parameter names.

Properties

alg: string

Algorithm Header Parameter

Identifies the cryptographic algorithm used to encrypt or determine the value of the Content Encryption Key (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.

"alg" values should either be registered in the IANA "JSON Web Signature and Encryption Algorithms" registry or be a value that contains a Collision-Resistant Name. The "alg" value is a case-sensitive ASCII string. This Header Parameter MUST be present and MUST be understood and processed by implementations.

apu?: Uint8Array

Agreement PartyUInfo Header Parameter

The "apu" (agreement PartyUInfo) value is a base64url-encoded octet sequence containing information about the producer of the JWE. This information is used by the recipient to determine the key agreement algorithm and key encryption algorithm to use to decrypt the JWE.

Note: This parameter is intended only for use when the recipient is a key agreement algorithm that uses public key cryptography.

apv?: Uint8Array

Agreement PartyVInfo Header Parameter

The "apv" (agreement PartyVInfo) value is a base64url-encoded octet sequence containing information about the recipient of the JWE. This information is used by the recipient to determine the key agreement algorithm and key encryption algorithm to use to decrypt the JWE.

Note: This parameter is intended only for use when the recipient is a key agreement algorithm that uses public key cryptography.

crit?: string[]

Critical Header Parameter

Indicates that extensions to JOSE RFCs are being used that MUST be understood and processed.

cty?: string

Content Type Header Parameter

enc: string

Encryption Algorithm Header Parameter

Identifies the content encryption algorithm used to encrypt and integrity-protect (also known as "authenticated encryption") the plaintext and to integrity-protect the Additional Authenticated Data (AAD), if any. 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 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.

epk?: Uint8Array

Ephemeral Public Key Header Parameter

The "epk" (ephemeral public key) value created by the originator for the use in key agreement algorithms. It is the ephemeral public key that corresponds to the key used to encrypt the JWE. This value is represented as a JSON Web Key (JWK).

Note: This parameter is intended only for use when the recipient is a key agreement algorithm that uses public key cryptography.

iv?: Uint8Array

Initialization Vector Header Parameter

The "iv" (initialization vector) value is a base64url-encoded octet sequence used by the specified "enc" algorithm. The length of this Initialization Vector value MUST be exactly equal to the value that would be produced by the "enc" algorithm.

Note: With symmetric encryption algorithms such as AES GCM, this Header Parameter MUST be present and MUST be understood and processed by implementations.

jku?: string

JWK Set URL Header Parameter

jwk?: Jwk

JSON Web Key Header Parameter

kid?: string

Key ID Header Parameter

p2c?: number

PBES2 Count Header Parameter

The "p2c" (PBES2 count) value is an integer indicating the number of iterations of the PBKDF2 algorithm performed during key derivation.

Note: The iteration count adds computational expense, ideally compounded by the possible range of keys introduced by the salt. A minimum iteration count of 1000 is RECOMMENDED.

p2s?: string

PBES2 Salt Input Header Parameter

The "p2s" (PBES2 salt) value is a base64url-encoded octet sequence used as the salt value input to the PBKDF2 algorithm during key derivation.

The salt value used is (UTF8(Alg) || 0x00 || Salt Input), where Alg is the "alg" (algorithm) Header Parameter value.

Note: The salt value is used to ensure that each key derived from the master key is independent of every other key. A suitable source of salt value is a sequence of cryptographically random bytes containing 8 or more octets.

tag?: Uint8Array

Authentication Tag Header Parameter

The "tag" value is a base64url-encoded octet sequence containing the value of the Authentication Tag output by the specified "enc" algorithm. The length of this Authentication Tag value MUST be exactly equal to the value that would be produced by the "enc" algorithm.

Note: With authenticated encryption algorithms such as AES GCM, this Header Parameter MUST be present and MUST be understood and processed by implementations.

typ?: string

Type Header Parameter

x5c?: string[]

X.509 Certificate Chain Header Parameter

x5t?: string

X.509 Certificate SHA-1 Thumbprint Header Parameter

x5u?: string

X.509 URL Header Parameter