dvsekhvalnov / jose-jwt

Ultimate Javascript Object Signing and Encryption (JOSE), JSON Web Token (JWT) and Json Web Keys (JWK) Implementation for .NET and .NET Core
MIT License
936 stars 184 forks source link

Windows Cryptography Next Generation (CNG) is not supported on this platform. #230

Closed vinaykasireddy closed 6 months ago

vinaykasireddy commented 1 year ago

We are getting the following issue when we try to run the code in Linux OS. This is not a problem when the run the same in windows.

Is this nuget package OS dependant? Please advise.

Our application is running on .NET 6 and is referring 4.1.0 version of this nuget package.

"Windows Cryptography Next Generation (CNG) is not supported on this platform."

image image

ERROR

image

dvsekhvalnov commented 1 year ago

Well, some crypto primitives in .net core are not supported (at least was not in a past) on Linux.

I'm out of laptop for next couple weeks, so can't check exact details, but most likely you are running into this.

On Tue, Aug 1, 2023, 14:06 Vinay Kasireddy @.***> wrote:

We are getting the following issue when we try to run the code in Linux OS. This is not a problem when the run the same in windows.

Is this nuget package OS dependant? Please advise.

Our application is running on .NET 6 and is referring 4.1.0 version of this nuget package.

"Windows Cryptography Next Generation (CNG) is not supported on this platform."

[image: image] https://user-images.githubusercontent.com/2632995/257495247-4f28b6de-1e48-499c-84cd-dc856b25e2bd.png [image: image] https://user-images.githubusercontent.com/2632995/257495426-a726694c-a70a-4525-9a45-5e8b482fd105.png

ERROR

[image: image] https://user-images.githubusercontent.com/2632995/257494623-c27e5797-92f1-4272-82e4-0176e5baf989.png

— Reply to this email directly, view it on GitHub https://github.com/dvsekhvalnov/jose-jwt/issues/230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARXMESEEMDDVJJJGK4FANLXTDPMLANCNFSM6AAAAAA27SY6VA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dvsekhvalnov commented 1 year ago

Hi @vinaykasireddy , well i'm back if you want me to check something.

As i mentioned previously ECDH key management have some limited support on Linux due to the fact some crypto was not provided by .net framework.

digaomatias commented 1 year ago

I've forked this project and I'm working on making it work on Linux. @dvsekhvalnov I'll reach out to you sometime to see if you would like to discuss the changes and have a PR. It seems we can make it work by replacing CngKey for ECDiffieHellman. But we need to discuss whether we replace it or if we try to have both implementations in place. I'm working on replacing CngKey due to the fact it's probably not gonna be supported in .Net Core.

dvsekhvalnov commented 1 year ago

Hi @digaomatias, PRs always welcome :)

If you want to discuss technical design decisions upfront - also fine, let me know.

Also please checkout https://github.com/dvsekhvalnov/jose-jwt/issues/219 , some related work may be.

dvsekhvalnov commented 6 months ago

v5.0.0 released to nuget.org

https://github.com/dvsekhvalnov/jose-jwt/releases/tag/v5.0.0