JwtHeader Constructor (SigningCredentials)

Creates a new JwtHeader object with the Header Parameters as follows: { { typ, JWT }, { alg, Mapped(System.IdentityModel.Tokens.SigningCredentials.SignatureAlgorithm) } }

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)

Syntax

'Declaration
Public Sub New ( _
    signingCredentials As SigningCredentials _
)
public JwtHeader(
    SigningCredentials signingCredentials
)
public:
JwtHeader(
    SigningCredentials^ signingCredentials
)
new : 
        signingCredentials:SigningCredentials -> JwtHeader
public function JwtHeader(
    signingCredentials : SigningCredentials
)

Parameters

Remarks

For each SecurityKeyIdentifierClause in signingCredentials.SigningKeyIdentifier, if the clause is a NamedKeySecurityKeyIdentifierClause, the Header Parameter in the form of { clause.Name, clause.KeyIdentifier } will be added. For example, if clause.Name == 'kid' and clause.Keyidentifier == 'SecretKey99', the JSON object { kid, SecretKey99 } would be added.

In addition, if the SigningCredentials property is of type X509SigningCredentials, the JSON object { x5t, Base64UrlEncoded(System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString) } will be added. This simplifies the common case where an X509Certificate is used.

SignatureAlgorithm describes the algorithm that is discoverable by the CLR runtime. The { alg, 'value' } placed in the header reflects the JWT specification. OutboundAlgorithmMap contains a signature mapping where the 'value' above will be translated according to this mapping. The current mapping is:

http://www.w3.org/2001/04/xmldsig-more#rsa-sha256

RS256

http://www.w3.org/2001/04/xmldsig-more#hmac-sha256

HS256

.NET Framework Security

See Also

Reference

JwtHeader Class

JwtHeader Overload

System.IdentityModel.Tokens Namespace