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