SPCP Known Issues

.NET JWT Decryption: ECDH-ES not supported on Linux

When using jose-jwt to decrypt JWT that are encrypted using ECDH-ES algorithms, we will run into the following exception when running the code on Linux environments:

Unhandled exception. System.PlatformNotSupportedException: Windows Cryptography Next Generation (CNG) is not supported on this platform.

Root Cause

The library uses CNG, which is Windows only and not available on Linux.

Until this issue is resolved and released for jose-jwt, ECDH-ES decryption will not work on Linux.

Solution

  • If possible, use RSA algorithms instead. RSA algorithms are supported on both Windows and Linux.
  • If the use of ECDH-ES algorithms is mandatory, handle the decryption of JWT on other platforms such as NodeJS instead of using .NET.