Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are the private key and the certificate file the same file?

I'm following the steps on this website to set my environment variables. I have my private key file, but not the certificate file, so I'm just wondering if they are the same file?


share|improve this question

The public and private keys together make up a complete certificate. A public key can be signed by a Certificate Authority as well. If you're setting up server software, it will either want both keys in a single file (common in Windows environments) or each key separately (common in *nix environments).

share|improve this answer
yes, I'm setting up the Command-tools on Windows. How do I 'combine' both keys into a certificate then? Thanks – onetwothree Jan 2 '13 at 17:48

The private key and the certificate are two different things. The private key is known only to the subject of the certificate. The certificate is public and binds the private key to an identity. Some applications want these as separate files, some want them combined into a single file.

A private key or a certificate can be provided in either PEM or DER format. Typically, files in PEM format have a .pem extension. Files in DER format can have a .der extension, but more commonly, certificates have a .cer extension. You can tell these formats apart because PEM is a text format and should contain a line that starts "-----BEGIN".

If the private key and certificate are combined into a single file, that would typically be a PKCS7 or PKCS12 file. The extension for PKCS7 files is often .p7. For PCKS12, often it's pfx.

If you don't have a certificate, the private key won't do you any good yet. A certificate authority has to issue the certificate to you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.