![]() ![]() ![]() Private const string RsaPublickeyPemFooter = "-END RSA PUBLIC KEY-" Private const string RsaPublickeyPemHeader = "-BEGIN RSA PUBLIC KEY-" In C#, this looks like: public static class RSAExtensions Importing the DER blob by using RSA.ImportRSAPublicKey or RSA.ImportSubjectPublicKeyInfo.Base64-decoding the body to get the DER blob.Structure (identified by BEGIN RSA PUBLIC KEY) or a X.509 SubjectPublicKeyInfo structure Parsing the PEM header/footer to determine whether we’re dealing with a PKCS#1 RSAPublicKey.Therefore, we can reimplement ImportFromPem by: Structure, a SubjectPublicKeyInfo structure, or something else entirely. Recall that the header of a PEM file indicates whether the file contains a RSAPublicKey Which imports a public key from a DER-encoded X.509 SubjectPublicKeyInfo structure Which imports a public key from a DER-encoded PKCS#1 RSAPublicKey structure NET Core 3.1 and older versions don’t support RSA.ImportFromPem, We can fill that gap.NET Core 3.1 and belowĪlthough. Offer that functionality – but with some extension methods and a little help from CryptoAPI, NET 5 and 6, we can use RSA.ImportFromPem NET Framework versions Posted on 2021.12.05
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |