Base64 X.509 certificate public key

I am trying to find the base64 public key for the certificate I'm working with. The public key that I found on the certificate details tab is not base64, and I am asked to provide a base64 public key.

Is there a way to get the base64 public key version? Can this be done by taking the public key from the certificate and encrypting it to base64? For example, the following is the public key for the certificate:

"30 82 01 0a 02 82 01 01 00 bc 39 25 06 5d 99 a4 05 5f e7 fc 59 1f 28 b5 48 d2 0d 2e ea ab eb ed 74 ef c9 2f 90 f8 ad 96 80 24 0f c2 dc 71 58 ea 3e fa 5c c9 29 87 51 7c cb 54 28 7c f9 10 15 b0 ac 8f eb 9e d3 d7 70 35 93 8a c7 1f 45 97 e3 c8 0b 72 a1 65 79 cf 74 6c 87 d9 eb 7d a0 b9 0e 4b 45 3d 81 f0 18 6e 9f 97 11 54 cb d8 e2 35 1a 4b e7 4d bf 68 1d ad 4e ca 57 25 9e 2f f7 f8 44 6f c2 0c 78 d8 19 ef 22 5a 9f 78 9f 17 1a b8 c0 72 0f 51 5c 21 6f c9 1e 80 de 7c 25 47 d0 28 01 2a 94 6e 34 39 1f 42 39 be 5f 0e c2 7c b4 fa a5 b9 05 4e 9c 45 75 63 a3 87 c3 e5 dd 54 35 85 d4 8d c2 5f da 6f 86 12 cf b3 8b 65 23 1d 34 43 c5 2e b1 49 56 56 25 93 f7 09 bf 9e 48 21 91 6a de 27 9e 6d 38 2f f5 f4 93 23 46 e8 41 b4 21 b4 02 50 79 71 48 72 0f 57 46 a0 20 c0 19 02 f9 d4 76 02 2d 85 fd 79 cd 70 fc 41 8b 02 03 01 00 01 "

How can I convert this to base64? Thank you for your help!

+7
base64 ssl-certificate x509 public-key-encryption
source share
2 answers

I assume that you are on the windows.

How I did this is to install a certificate. Open certificates (from mmc or directly) Open the certificate in question.

On the "Details" tab there is an option "Copy to file". Click on until the export file format appears.

Select Base-64 encoded X.509 (.cer). Save to the desktop.

If you open this file in notepad, it will display a base64 encoded public key between the ---- BEGIN CERTIFICATE ---- and ----- END CERTIFICATE ------

Edit:

I save this base64 string and then convert back to code to get the actual certificate. This is pretty easy.

var base64Cert = // read from Db or somewhere var base64EncodedStr = Encoding.Unicode.GetString(base64Cert); var cert = new X509Certificate2(Convert.FromBase64String(base64EncodedStr), "password", X509KeyStorageFlags.PersistKeySet); if(cert != null) { // use certificate } 
+15
source share

You can use ASN.1 Editor . It has a good data converter, which allows you to convert from HEX, BASE64, PEM to any of the previously mentioned.

enter image description here

+1
source share

All Articles