Nyamikan.Asn1PKCS 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nyamikan.Asn1PKCS --version 0.1.1
NuGet\Install-Package Nyamikan.Asn1PKCS -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nyamikan.Asn1PKCS" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nyamikan.Asn1PKCS --version 0.1.1
#r "nuget: Nyamikan.Asn1PKCS, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Nyamikan.Asn1PKCS as a Cake Addin
#addin nuget:?package=Nyamikan.Asn1PKCS&version=0.1.1

// Install Nyamikan.Asn1PKCS as a Cake Tool
#tool nuget:?package=Nyamikan.Asn1PKCS&version=0.1.1


PKCS #1/PKCS #8 RSA key ASN.1 encoder/decoder for C#.


  • .NET Standard 1.3


string derBase64EncodedString = "MEgCQQDOncyWnMXJmnkc5bqmRv5+x/KKes5uBHkoi1rywCLg4YJ1d+BvXSJbQ+bQdEWcporNeYo8hYLIQHZUz1SLiZKZAgMBAAE=";

RSAParameters rsaParameters = PKCS1DERDecoder.DecodePublicKey(derBase64EncodedString);
// rsaParameters.Modulus: byte[] { 0xCE, 0x9D, 0xCC, 0x96, 0x9C, 0xC5, 0xC9, 0x9A, 0x79, 0x1C, 0xE5, 0xBA, 0xA6, 0x46, 0xFE, 0x7E, 0xC7, 0xF2, 0x8A, 0x7A, 0xCE, 0x6E, 0x04, 0x79, 0x28, 0x8B, 0x5A, 0xF2, 0xC0, 0x22, 0xE0, 0xE1, 0x82, 0x75, 0x77, 0xE0, 0x6F, 0x5D, 0x22, 0x5B, 0x43, 0xE6, 0xD0, 0x74, 0x45, 0x9C, 0xA6, 0x8A, 0xCD, 0x79, 0x8A, 0x3C, 0x85, 0x82, 0xC8, 0x40, 0x76, 0x54, 0xCF, 0x54, 0x8B, 0x89, 0x92, 0x99 }
// rsaParameters.Exponent: byte[] { 0x01, 0x00, 0x01 }
RSAParameters rsaParameters = new RSAParameters();
rsaParameters.Modulus = new byte[] { 0xBE, 0x7D, 0xF2, 0xE9, 0x01, 0xCA, 0x41, 0x62, 0x6F, 0x1B, 0x88, 0x8A, 0xB9, 0x65, 0x95, 0x16, 0x25, 0x69, 0xDF, 0xC9, 0xB2, 0x48, 0x3D, 0x96, 0x65, 0x75, 0x13, 0x4D, 0x70, 0x52, 0x19, 0xF0, 0x52, 0xEC, 0xF4, 0x6E, 0xDA, 0x02, 0x76, 0x2C, 0x08, 0xB5, 0xB3, 0x8F, 0x5D, 0x76, 0x99, 0x1D };
rsaParameters.Exponent = new byte[] { 0x11 };

string derBase64EncodedString = PKCS8DEREncoder.EncodePublicKeyToBase64(rsaParameters);
// derBase64EncodedString: "MEowDQYJKoZIhvcNAQEBBQADOQAwNgIxAL598ukBykFibxuIirlllRYlad/Jskg9lmV1E01wUhnwUuz0btoCdiwItbOPXXaZHQIBEQ=="

Other examples: https://github.com/typewriter/Asn1PKCS/tree/master/Asn1PKCSTest



Product 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. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.0 181 5/6/2023
0.1.1 3,139 2/7/2019