web-push-libs / web-push-csharp

Web Push library for C#
Mozilla Public License 2.0
429 stars 108 forks source link

Use the WebPushEncryption nuget package directly #50

Closed tuwrraphael closed 5 years ago

tuwrraphael commented 6 years ago

Why was it decided not to use the package directly but to copy the implementation? Was it due to compatibility issues?

The README states that the Encryption code of https://github.com/LogicSoftware/WebPushEncryption was used.

coryjthompson commented 6 years ago

The implementation required .NET framework and was not compatible with dotnet core.

The code was rewritten to use bouncycastle portable instead of System.Security.Cryptography.

However I've noticed that these libraries are now supported as of dotnet core 2.1, might be worth revisiting.

tuwrraphael commented 5 years ago

You are right, of course it uses System.Security.Cryptography, I didn't see. In september I experimented with the ported System.Security.Cryptography of the dotnet core 2.1, and sending no-content messages was OK, but the AuthenticatedAes was missing, which is required for content encryption.

tuwrraphael commented 5 years ago

As I read here https://blogs.msdn.microsoft.com/dotnet/2018/12/04/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks/ in .net core 3 preview 1 the missing AES-GCM support was added. Maybe I can create a PR for the WebPushEncryption to support .net core in the future; I think .net core 3 is planned to be released this year.

coryjthompson commented 5 years ago

For backwards compatibility we will need to keep bouncycastle, but we can start using AES-GCM for newer versions.