![]() |
VOOZH | about |
dotnet add package OpenSSL.X509Certificate2.Provider --version 1.3.0.1
NuGet\Install-Package OpenSSL.X509Certificate2.Provider -Version 1.3.0.1
<PackageReference Include="OpenSSL.X509Certificate2.Provider" Version="1.3.0.1" />
<PackageVersion Include="OpenSSL.X509Certificate2.Provider" Version="1.3.0.1" />Directory.Packages.props
<PackageReference Include="OpenSSL.X509Certificate2.Provider" />Project file
paket add OpenSSL.X509Certificate2.Provider --version 1.3.0.1
#r "nuget: OpenSSL.X509Certificate2.Provider, 1.3.0.1"
#:package OpenSSL.X509Certificate2.Provider@1.3.0.1
#addin nuget:?package=OpenSSL.X509Certificate2.Provider&version=1.3.0.1Install as a Cake Addin
#tool nuget:?package=OpenSSL.X509Certificate2.Provider&version=1.3.0.1Install as a Cake Tool
Parses OpenSSL public and private key components and returns a X509Certificate2 with RSA/RSACryptoServiceProvider. (Based on http://www.jensign.com/opensslkey/opensslkey.cs (Archive Link))
Generate public certificate + privatekey using:
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate_pub.crt
If you just want to decode the private key into RSAParameters, use the following code:
string privateKeyText = File.ReadAllText("private.key");
IOpenSSLPrivateKeyDecoder decoder = new OpenSSLPrivateKeyDecoder();
RSAParameters parameters = decoder.DecodeParameters(privateKeyText);
// do something with the parameters ...
If you want to decode the private key into a RSACryptoServiceProvider, use the following code:
string privateKeyText = File.ReadAllText("private.key");
IOpenSSLPrivateKeyDecoder decoder = new OpenSSLPrivateKeyDecoder();
RSACryptoServiceProvider cryptoServiceProvider = decoder.Decode(privateKeyText);
// Example: sign the data
byte[] hello = new UTF8Encoding().GetBytes("Hello World");
byte[] hashValue = cryptoServiceProvider.SignData(hello, CryptoConfig.MapNameToOID("SHA256"));
// Example: use the PrivateKey from above for signing a JWT token using Jose.Jwt:
string token = Jose.JWT.Encode(payload, cryptoServiceProvider, JwsAlgorithm.RS256);
string certificateText = File.ReadAllText("certificate_pub.crt");
string privateKeyText = File.ReadAllText("private.key");
ICertificateProvider provider = new CertificateFromFileProvider(certificateText, privateKeyText);
X509Certificate2 certificate = provider.Certificate;
// Example: use the PrivateKey from the certificate above for signing a JWT token using Jose.Jwt:
string token = Jose.JWT.Encode(payload, certificate.PrivateKey, JwsAlgorithm.RS256);
If you just want to decode the rsa public key into RSAParameters, use the following code:
Export the public key from the private key with openssl
openssl rsa -in private.key -out public.key -pubout
string publicKeyText = File.ReadAllText("public.key");
IOpenSSLPublicKeyDecoder decoder = new OpenSSLPublicKeyDecoder();
RSAParameters parameters = decoder.DecodeParameters(publicKeyText);
Entity Framework Extensions and Dapper Plus are major sponsors and proud to contribute to the development of OpenSSL.PrivateKeyDecoder, OpenSSL.PublicKeyDecoder and OpenSSL.X509Certificate2.Provider.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 netcoreapp1.0 was computed. netcoreapp1.1 netcoreapp1.1 was computed. netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.3 netstandard1.3 is compatible. netstandard1.4 netstandard1.4 was computed. netstandard1.5 netstandard1.5 was computed. netstandard1.6 netstandard1.6 was computed. netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net20 net20 is compatible. net35 net35 is compatible. net40 net40 was computed. net403 net403 was computed. net45 net45 is compatible. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen30 tizen30 was computed. tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Universal Windows Platform | uap uap was computed. uap10.0 uap10.0 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on OpenSSL.X509Certificate2.Provider:
| Package | Downloads |
|---|---|
|
Stripe.Api
Stripe API for .NET by CloudRail provides an easy solution to perform single charges, refund previously made charges and manage subscriptions. Get a free license key at: https://cloudrail.com Features: - Perform charges - Refund previously made charges - Manage subscriptions - Advance Request: Use any Stripe functionality that is missing from CloudRail Platform Supports: Cloudrail SDK is built with Microsoft .NET Standard 2.0 which supports the following - .NET Framework 4.6.1 - .NET Core 2.0 - Mono 5.4 |
|
|
Twilio.Api
Twilio API for .NET by CloudRail provides an easy solution to programmatically send SMS messages. Get a free license key at: https://cloudrail.com Platform Supports: Cloudrail SDK is built with Microsoft .NET Standard 2.0 which supports the following - .NET Framework 4.6.1 - .NET Core 2.0 - Mono 5.4 |
|
|
Viber.Api
Viber API for .NET by CloudRail provides an instant messaging service and software application in which you can send text, image, videos and files. Get a free license key at: https://cloudrail.com Features: - Send text messages - Send files, images, videos and audios - Parse messages received on your webhook - Download the content of an attachment sent to your webhook - Advance Request: Use any Viber functionality that is missing from CloudRail Platform Supports: Cloudrail SDK is built with Microsoft .NET Standard 2.0 which supports the following - .NET Framework 4.6.1 - .NET Core 2.0 - Mono 5.4 |
|
|
YouTube.Api
YouTube API for .NET by CloudRail provides an easy solution to search videos, upload videos and many more features. Get a free license key at: https://cloudrail.com Features: - Search for videos - Upload videos - Get a list of videos for a channel - Get channel details - Get your own channel details - Get video details - Advance Request: Use any YouTube functionality that is missing from CloudRail Platform Supports: Cloudrail SDK is built with Microsoft .NET Standard 2.0 which supports the following - .NET Framework 4.6.1 - .NET Core 2.0 - Mono 5.4 |
|
|
LinkedIn.Api
LinkedIn API for .NET by CloudRail provides an easy solution to login and get basic user information Get a free license key at: https://cloudrail.com Features: - Get profile information, including full names, emails, genders, date of birth, and locales. - Retrieve profile pictures. - Login using the Social Network. - Advance Request: Use any LinkedIn functionality that is missing from CloudRail Platform Supports: Cloudrail SDK is built with Microsoft .NET Standard 2.0 which supports the following - .NET Framework 4.6.1 - .NET Core 2.0 - Mono 5.4 |
This package is not used by any popular GitHub repositories.
See CHANGELOG.md