You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have error in writer3.WriteTokenString(asyDescriptorPlainText); with exception
System.NotSupportedException: 'Key wrap is not supported for algorithm: 'A256GCM' with a key of type 'EC' and size of 521 bits.'
string publicKeyStringShahkar = "-******************-";
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
int secondsSinceEpoch = (int)t.TotalSeconds;
var asymmetricJwkKey = AsymmetricJwk.FromPem(publicKeyStringShahkar);
var payload = new
{
data = input,
iat = secondsSinceEpoch
};
string jsonPayload = JsonConvert.SerializeObject(payload);
var asyDescriptorPlainText = new PlaintextJweDescriptor(asymmetricJwkKey,
KeyManagementAlgorithm.EcdhEsA256KW, EncryptionAlgorithm.A256Gcm)
{
Payload = jsonPayload
};
// The descriptor sets the 'alg' with value 'A256GCMKW' and 'enc' with value 'A128CBC-HS256'
var writer3 = new JwtWriter();
var token3 = writer3.WriteTokenString(asyDescriptorPlainText);
The text was updated successfully, but these errors were encountered:
i have error in writer3.WriteTokenString(asyDescriptorPlainText); with exception
System.NotSupportedException: 'Key wrap is not supported for algorithm: 'A256GCM' with a key of type 'EC' and size of 521 bits.'
The text was updated successfully, but these errors were encountered: