I'm trying to sign JWToken using RsaSsaPssSha256, with a self signed X509certificate2 that i read from the keystore.
using .net 4.61;
- Tried to use System.IdentityModel.Tokens.Jwt from Microsoft:
SecurityTokenDescriptor tokenDescriptor = new SecurityTokenDescriptor
{
Subject = ,
SigningCredentials = new SigningCredentials(privateKey, SecurityAlgorithms.RsaSsaPssSha256Signature),
Expires = DateTime.UtcNow.AddMinutes(expirationMinutes),
};
and got the following error:
"IDX10634: Unable to create the SignatureProvider.\nAlgorithm: 'PS256', SecurityKey: 'Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: 'xxxxxxxxxxxxxxxxxxxxxxxxxx', InternalId: 'xxxxx-xxxxxx-xxxx-xxxxxx'.'\n is not supported. The list of supported algorithms is available here: https://aka.ms/IdentityModel/supported-algorithms"
needless to say that SecurityAlgorithms.RsaSha256 is working as expected.
2. Tried to use Jose-JWT module and got the following error:
"RsaUsingSha with PSS padding alg expects key to be of CngKey type."
what am i missing here?