Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssl certificate- get private key from csr

Is it possible to export private key from CERTIFICATE SIGNING REQUEST?

I have a CSR file and some CRT files. Now I have to install this certificate. How do I do it or do I need some other files in order to install this certificate?

like image 717
lazyCoding Avatar asked Jun 29 '14 07:06

lazyCoding


People also ask

Can you get a private key from a CSR?

A private key is created by you — the certificate owner — when you request your certificate with a Certificate Signing Request (CSR). The certificate authority (CA) providing your certificate (such as DigiCert) does not create or have your private key.

Can private key be extracted from certificate?

crt and privateKey. key can be extracted from your Personal Information Exchange file (certificate. pfx) using OpenSSL.

Where is private key stored when CSR is generated?

The utility stores the CSR and private key in the Windows local computer certificate store on the computer on which you generated the CSR. You can confirm that the CSR and private key are properly stored by using the Microsoft Management Console (MMC) Certificate snap-in.

How do I know if a CSR has a private key?

In the Certificate windows that appears, you should see a note with a key symbol underneath the Valid from field that says, "You have a private key that corresponds to this certificate." If you do not see this, then your private key is not attached to this certificate, indicating a certificate installation issue.


2 Answers

No you cannot export the private key from CSR because the CSR does not contain any private key.

You need another file that has a private key and if you have that you won't need the CSR to extract the private key.

like image 124
m0g Avatar answered Sep 29 '22 20:09

m0g


You create CSR from a private key not other way around.

In general the process goes like

  1. You create private key
  2. You create CSR Hand CSR to Certificate Authority aka CA
  3. CA will give you a Certificate
  4. you are good to go with you private key and with certificate depending upon client e.g. PHP Curl is fine with it
  5. You may also combine your private key and Certificate using PKCS12 format depending upon your client requirements.
like image 20
Mubashar Avatar answered Sep 29 '22 20:09

Mubashar