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
)
Public Shared Function CreateRsaToken (
pkcs12Certificate As X509Certificate2,
algorithm As String,
payload As JwtPayload,
<OutAttribute> ByRef token As String
) As JwtSecurityToken
public:
static JwtSecurityToken^ CreateRsaToken(
X509Certificate2^ pkcs12Certificate,
String^ algorithm,
JwtPayload^ payload,
[OutAttribute] String^% token
)
static member CreateRsaToken :
pkcs12Certificate : X509Certificate2 *
algorithm : string *
payload : JwtPayload *
token : string byref -> JwtSecurityToken
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:
JwtSecurityTokenA 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