-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to support .NET Standard and multi-targeting #68
Conversation
d81bf2b
to
dd1b0b2
Compare
👍 |
@onovotny now that you are targeting .NETStandard 1.x, it should be possible to re-enable the DotNetUtilities class, right? Specifically, it'd be awesome to re-expose the methods that convert back and forth between BC and System.Security X509Certificates. If I send you a PR, where should that go? I want to completely switch to using Portable.BouncyCastle packages instead of maintaining my own iOS and Android project files for BouncyCastle and the only thing I'm missing is those conversion methods. |
Looks like I actually only need 2 methods: |
a PR should go to the netstandard branch of my fork |
Looks like it's not possible even in netstandard1.3. I think I may just have to copy the The No worries. I was hoping I wouldn't need to do that, but alas... |
@jstedfast what netstandard version are they in? I personally have no objections to including a higher version if there's a need. Multi-targeting is easy :) |
I'm actually also targeting netstandard1.3 for MimeKit and MailKit. I just also have Xamarin-specific targets. I just realized, however, that Mono's X509Certificate2 implementation doesn't include the PrivateKey anyway, so |
I appreciate the offer, though! |
@jstedfast it's not hard to also target netstandard1.5/1.6 if that helps? better than Xamarin specific targets. |
Did you ever think about creating a shared project? Shared projects are supported since Visual Studio 2013 Update 2, and as long as they do not have dependencies, they are a godsend for cross platform development. |
@martinstoeckli I am familiar with shared projects, but what benefits would you see in this case over simply multi-targeting? One benefit I see with multi-targeting and the SDK-style projects are that all of the files can stay as-is, making it much easier to maintain. |
59809c9
to
303bae2
Compare
There are so many variations of targets (dotnet version, OS platform, 32-64 bit, .Net core, ...) that I often get into the situation, that external libraries are mutually exclusive and I cannot use them. A shared project, as long as it doesn't have any problematic dependencies, is compiled to the same target as the app itself and therefore is always compatible. The multi-target libraries have to be maintained for every future target, a shared library is pure code. Of course this is a bit simplified and I must admit that I didn't have any problems with bc-csharp library so far. Thanks again. |
Targeting .NET Standard 1.0 immediately gives support of .NET Core, .NET Framework 4.5+, Mono 4.6+ and a lot of other platforms. Building for "AnyCPU" will make library compatible with x86, x64, ARM etc. Library multi-targeting .NET Standard 1.0 and .NET Framework 1.1, built for AnyCPU, won't be mutually exclusive with anything else, until you have some unusual use case (e.g. your application needs to work with Xamarin.Mac 2.0). |
beafff9
to
ebb1374
Compare
@jstedfast circling back on this, I just added a |
@onovotny awesome! (sorry, just saw your comment now) |
Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/commits) --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.0.0 to 17.1.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](microsoft/vstest@v17.0.0...v17.1.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
….Test.Sdk-17.1.0
Bumps [NUnit](https://github.com/nunit/nunit) from 3.13.2 to 3.13.3. - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/v3.13.3/CHANGES.md) - [Commits](nunit/nunit@v3.13.2...v3.13.3) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Any reason this hasn't been merged after 6 years when this PR its still being maintained @peterdettman |
Just as a follow on here this should be the # 1 priority of the library IMO if you check nuget a vast majoirty of users of the library are using other non-offical distributions of the library mainly targeted towards newer version of .net such as .net core or anything that supports .net standard: If people aren't using this library then donations and support will dwindle over time for the C# version risking the existence of the library. Moving to modernizing will increase the users and potentially donations if it can be widely advertised, maybe even have a specific donation tracker towards funding the modernization effort! I've left a comment on #50 about further effort that should go into future work where i go over the current minimum supported .net framework versions which shows that .net standard 2.0 should be the minimum development target for this library. I would argue that supporting older .net framework versions and continuing to maintain support for these versions is itself promoting potentially outdated and vulnerable OS's and .net framework versions as these older framework version updates are tied with end of life os's So because of that i think this PR should be redone with this in mind. and then in the future a BC 2.0 release should be done which drops support for older .net releases. Would be a great time to also do a lot of modernization work to move to generic collections, or Span/Memory based apis potentially. Since it would be a good opportunity for doing an API compatibility break. (though i don't know what BC's policy is on such api deprecation and whatnot.) Older versions can still be maintained in branches for critical bugfixes and security fixes. |
I'll add that AFAIK, the BouncyCastle nuget package isn't owned/maintained by anyone at BC itself and should not be considered trusted. My fork is the apparent de-facto package and the CI pipeline is setup and public. The code is signed and published via pipelines, with all reproducible build checks in place, so it's also the most traceable/auditable version with a clear provenance. I'm more than happy to continue maintaining/publishing that package as needed, and if the BC team makes a formal request to NuGet, we can get ownership of the "main" BouncyCastle package transferred over as well. |
Yeah that's fair, though one thing that's important to me about this issue regardless of who's publishing it, is that the longer this isn't merged the longer it will be before library modernization can be done due to the library targeting .net 1.1 still (as far as i can tell) |
When will we get .NET 6 support utilizing Span and ref struct |
Bumps [NerdBank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning) from 3.4.255 to 3.5.109. - [Release notes](https://github.com/dotnet/Nerdbank.GitVersioning/releases) - [Commits](https://github.com/dotnet/Nerdbank.GitVersioning/commits) --- updated-dependencies: - dependency-name: NerdBank.GitVersioning dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.1.0 to 17.3.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](microsoft/vstest@v17.1.0...v17.3.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
….Test.Sdk-17.3.1
…ersioning-3.5.109
Looks like now judging by the commits happening in the repo currently! |
Yes, we're just waiting on a signing certificate so we can do a proper job on the packaging. |
Here it is: https://www.nuget.org/packages/BouncyCastle.Cryptography. This release is dedicated to @clairernovotny for keeping the project alive these past few years with |
This is the latest branch of the PCL version, updated to support:
net6.0
net4
netstandard2.0
That provides the widest range of functionality to supported platforms, including Xamarin and .NET Core. The
netstandard2.0
version has the exact same surface area as the desktopnet4
version.Fixes #41