<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.17.0" />

System.IdentityModel.Tokens.Jwt.JwtHeader

public class JwtHeader : Dictionary<string, object>
Initializes a new instance of JwtHeader which contains JSON objects representing the cryptographic operations applied to the JWT and optionally any additional properties of the JWT. The member names within the JWT Header are referred to as Header Parameter Names.

These names MUST be unique and the values must be String(s). The corresponding values are referred to as Header Parameter Values.

public string Alg { get; }

Gets the signature algorithm that was used to create the signature.

public string Cty { get; }

Gets the content mime type (Cty) of the token.

public string Enc { get; }

Gets the encryption algorithm (Enc) of the token.

public EncryptingCredentials EncryptingCredentials { get; }

Gets the EncryptingCredentials passed in the constructor.

public string IV { get; }

Gets the iv of symmetric key wrap.

public string Kid { get; }

Gets the key identifier for the security key used to sign the token

public SigningCredentials SigningCredentials { get; }

Gets the SigningCredentials passed in the constructor.

public string Typ { get; }

Gets the mime type (Typ) of the token.

public string X5c { get; }

Gets the certificate used to sign the token

public string X5t { get; }

Gets the thumbprint of the certificate used to sign the token

public string Zip { get; }

Gets the 'value' of the 'zip' claim { zip, 'value' }.

public JwtHeader()

Initializes a new instance of the JwtHeader class. Default string comparer Ordinal.

public JwtHeader(SigningCredentials signingCredentials)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }

public JwtHeader(EncryptingCredentials encryptingCredentials)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, EncryptingCredentials.Alg }, { enc, EncryptingCredentials.Enc } }

public JwtHeader(SigningCredentials signingCredentials, IDictionary<string, string> outboundAlgorithmMap)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }

public JwtHeader(SigningCredentials signingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }

public JwtHeader(SigningCredentials signingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType, IDictionary<string, object> additionalInnerHeaderClaims)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }

public JwtHeader(EncryptingCredentials encryptingCredentials, IDictionary<string, string> outboundAlgorithmMap)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, EncryptingCredentials.Algorithm } }

public JwtHeader(EncryptingCredentials encryptingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, EncryptingCredentials.Algorithm } }

public JwtHeader(EncryptingCredentials encryptingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType, IDictionary<string, object> additionalHeaderClaims)

Initializes a new instance of JwtHeader. With the Header Parameters:

{ { typ, JWT }, { alg, EncryptingCredentials.Algorithm } }

public static JwtHeader Base64UrlDeserialize(string base64UrlEncodedJsonString)

Deserializes Base64UrlEncoded JSON into a JwtHeader instance.

public virtual string Base64UrlEncode()

Encodes this instance as Base64UrlEncoded JSON.

public virtual string SerializeToJson()

Serializes this instance to JSON.