EggEgg.XC.RSAUtil
0.136.0-rc03
See the version list below for details.
dotnet add package EggEgg.XC.RSAUtil --version 0.136.0-rc03
NuGet\Install-Package EggEgg.XC.RSAUtil -Version 0.136.0-rc03
<PackageReference Include="EggEgg.XC.RSAUtil" Version="0.136.0-rc03" />
<PackageVersion Include="EggEgg.XC.RSAUtil" Version="0.136.0-rc03" />
<PackageReference Include="EggEgg.XC.RSAUtil" />
paket add EggEgg.XC.RSAUtil --version 0.136.0-rc03
#r "nuget: EggEgg.XC.RSAUtil, 0.136.0-rc03"
#addin nuget:?package=EggEgg.XC.RSAUtil&version=0.136.0-rc03&prerelease
#tool nuget:?package=EggEgg.XC.RSAUtil&version=0.136.0-rc03&prerelease
EN | 中文
Notice
This package is not the official version of GitHub Repository stulzq/RSAUtil but a custom modified version. Please go to NuGet XC.RSAUtil for the official one.
RSAUtil
.NET Core RSA algorithm helper tool, supports data encryption, decryption, signing, and signature verification. Supports three key formats: XML, PKCS1, and PKCS8. Supports key conversion for these three formats.
Installation via NuGet
Install-Package EggEgg.XC.RSAUtil
Documentation
Ready to use
You can use RSAUtilBase.LoadRSAKey
to quickly load private and public keys in XML, PKCS1, and PKCS8 formats, and paramters like the format and the bits of the RSA key can be auto-detected. The private key instance supports the functionality of the public key (public key encryption, signature verification).
Generating keys
Use the "RsaKeyGenerator" class. The result returned is a
KeyResult
containingprivateKey
andpublicKey
.
Format:
var keys = RsaKeyGenerator.XmlKey(2048); // XML format
// var keys = RsaKeyGenerator.Pkcs1Key(2048); // PKCS1 format
// var keys = RsaKeyGenerator.Pkcs8Key(2048); // PKCS8 format
var privateKey = keys.privateKey;
var publicKey = key.publicKey;
RSA key conversion
You can freely convert key formats using RsaKeyConvert.Format()
. For example:
RsaKeyConvert.Format(key, RsaKeyType.Private | RsaKeyType.Xml, RsaKeyType.Private | RsaKeyType.Pkcs1);
RsaKeyConvert.Format(key, RsaKeyType.Public | RsaKeyType.Xml, RsaKeyType.Public | RsaKeyType.Pkcs1);
RsaKeyConvert.Format(key, RsaKeyType.Private | RsaKeyType.Pkcs1, RsaKeyType.Public | RsaKeyType.Pkcs8);
Other hardcoded conversion methods can also be used under the RsaKeyConvert
class.
Encryption, decryption, signing, and signature verification
XML, Pkcs1, and Pkcs8 correspond to the classes:
RsaXmlUtil
,RsaPkcs1Util
,RsaPkcs8Util
. They inherit from the abstract classRSAUtilBase
.
- Encryption:
RSAUtilBase.RsaEncrypt()
- Decryption:
RSAUtilBase.RsaDecrypt()
- Sign:
RSAUtilBase.SignData()
- Verification:
RSAUtilBase.VerifyData()
Open-source components used
bc-csharp - onovotny
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Portable.BouncyCastle (>= 1.9.0)
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
136.1.0-rc54 | 9 | 4/17/2024 |
136.1.0-rc53 | 1 | 3/20/2024 |
136.1.0-rc52 | 4 | 3/20/2024 |
136.1.0-rc51 | 3 | 3/19/2024 |
136.1.0-rc50 | 3 | 3/18/2024 |
136.0.0-rc01 | 2 | 12/11/2023 |
0.136.0-rc03 | 3 | 12/7/2023 |
0.136.0-rc02 | 3 | 12/7/2023 |
0.136.0-rc01 | 2 | 12/6/2023 |
0.136.0-beta01 | 2 | 12/6/2023 |
Notice: This package is not the official version of GitHub Repository stulzq/RSAUtil but a custom modified version. Please go to https://www.nuget.org/packages/XC.RSAUtil for the official one.