mattosaurus / PgpCore

.NET Core class library for using PGP
MIT License
245 stars 98 forks source link

.net 8 upgrade #299

Closed manjzu closed 2 months ago

manjzu commented 2 months ago

looks like current package is built using .net 6, is there any plans of upgrading code to .net 8?

mattosaurus commented 2 months ago

It's built using .NET Standard v2.0 which supports .NET 8.

https://github.com/mattosaurus/PgpCore/blob/93b2ff9bf18dcad0d3859bf20cd1dc3d66b0252b/PgpCore/PgpCore.csproj#L4

https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

This is done to ensure the widest possible compatability.

The tests are .NET 6 and I'll probably update them at somepoint but this shouldn't make a difference to the library functionality.

manjzu commented 2 months ago

@mattosaurus version in the encrypted file seems to be showing description as .net6.0 "Version: BouncyCastle.NET Cryptography (net6.0) v2.4.0", which is deceiving.

mattosaurus commented 2 months ago

Ah, I see. The version info in the encrypted file comes from the underlying Bouncy Castle library which is built using .NET 6.

https://github.com/bcgit/bc-csharp/blob/41215d66a26f02d170bce5e0bdf052fdac1d7828/crypto/src/BouncyCastle.Crypto.csproj#L6

If desired you can set your own custom headers, which includes overwriting the version header.

https://github.com/mattosaurus/PgpCore/blob/93b2ff9bf18dcad0d3859bf20cd1dc3d66b0252b/PgpCore.Tests/UnitTests/Encrypt/EncryptSync.File.cs#L185-L217