Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is my certificate's private key

I've just obtained the certificate from GoGaddy. It came in a .ZIP file, which has two files in it:

"certificate.p7b" & "cetificate.crt"

I've installed both of them, but when I try to lookup the private key on any of them, I get NULL, which means that they have no private.

Of course, all this is a part of the bigger problem, where I'm trying to install a certificate for AZURE web site and it doesn't take .crt file so, I need to export it into the .pfx

By the way, I'm on a work laptop, which has some preinstalled certificates and all them have private keys. This is the code I use to lookup the private key:

X509Store store = new X509Store(StoreName.My);

store.Open(OpenFlags.MaxAllowed);

foreach (var certin store.Certificates)
{
    var pk = cert.PrivateKey;
}

WHERE IS THE PRIVATE KEY AND HOW CAN I OBTAIN IT?

like image 367
Ostati Avatar asked Aug 30 '13 21:08

Ostati


1 Answers

You already have it. The first thing you did in this process was to generate a key pair. Then you generated a CSR from the key pair, then you got that signed by the CA, now you have a signed certificate, and you still have the original key pair.

like image 93
user207421 Avatar answered Sep 28 '22 01:09

user207421