Click or drag to resize

JsonWebTokenUtilityCreateRsaToken Method

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

Namespace:  Hummingbird.TestFramework.Util
Assembly:  Hummingbird.TestFramework (in Hummingbird.TestFramework.dll) Version: 1.2.0.0
Syntax
public static JwtSecurityToken CreateRsaToken(
	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 RSA 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 RSA as algorithm, Or an exception will be thrown. use this function is the algorithm is rather RS256, RS384 or RS512.
See Also