Click or drag to resize

JsonWebTokenUtilityCreateEcdsaToken Method

Creates a Json Web Token (JWT) by given parameters (using asymmetric algorithm Ecdsa)

Namespace:  Hummingbird.TestFramework.Util
Assembly:  Hummingbird.TestFramework (in Hummingbird.TestFramework.dll) Version: 1.2.0.0
Syntax
public static JwtSecurityToken CreateEcdsaToken(
	X509Certificate2 pkcs12Certificate,
	string algorithm,
	JwtPayload payload,
	out string token
)

Parameters

pkcs12Certificate
Type: System.Security.Cryptography.X509CertificatesX509Certificate2
An PKCS#12 certificate containing the private key. Certificate must uses ECC as algorithm and the key length must longer than selected length.
algorithm
Type: SystemString
The signature or encryption algorithm, choose one from SecurityAlgorithms.
payload
Type: JwtPayload
The JWT payload.
token
Type: SystemString
The string representation of the web token that can be used by the client.

Return Value

Type: JwtSecurityToken
A Json Web Token generated with given parameters
Remarks
The certificate must use ECC as algorithm, Or an exception will be thrown. use this function is the algorithm is rather EC256, EC384 or EC512.
See Also