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
signingCredentials
Type: System.IdentityModel.Tokens.SigningCredentialsThe SigningCredentials that will be or were used to sign the JwtSecurityToken.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.