can a .cer file contain private key? (Security forum at Coderanch) (2024)

posted 17 years ago

I'm sure there would be a way to put a private key into the ".cer" file, but I'm equally certain this would be silly. The point of the certificate is to distribute the public key. If you distribute the private key, the public key is worthless. Likewise, I am pretty certain that your friend did _not_ get a ".cer" from VeriSign with a private key in it.

The general approach to getting certificates is to create the public/private key pair (these are _not_ the same value, each one is unique - but related). Then using the "public" key (it doesn't matter which one of the two you declare as "public", but one will be put into the certificate, and the other will be protected from anyone getting access - hence one is "public" and the other is "private"), you will generate a "Certificate Signing Request" (CSR - following "PKCS#10" specification from RSA). The CSR will contain identifying information about the certificate requestor, and the public key. This is sent to the Certification Authority (CA - e.g. VeriSign), who will (hopefully) verify the identity of the requestor, and issue the certificate (the ".CER" file). The issued certificate will contain all of the identifying information supplied to the CA, the public key from the requestor, _AND_ the CA's digital signature (a digest/hash of the data in the certificate, encrypted with the CA's private key). In order to verify the certificate, you simply use the CA's public key (which you get from their certificate), and decrypt the digest/hash value, and then run your own hash/digest of the certificate you were given - if the one in the signature matches the digest you generated - the certificate is the one issued by the CA.

If your private key is given out, then both the public and private keys are essentially useless. Sure, they can encrypt/decrypt for each other - but _anyone_ could perform either side of the equation, which means that you could never be sure who was doing what.

--<br />Robin D. Wilson

can a .cer file contain private key? (Security forum at Coderanch) (2024)

FAQs

Can a .cer file contain private key? (Security forum at Coderanch)? ›

cer is a public key certificate that can contain only public key but not private key.

Does .cer contain a private key? ›

cer file usually contains only the public key certificate. In contrast, a . pfx file is an all-encompassing container housing private and public key certificates.

What is a .cer certificate? ›

CER - Internet Security Certificate

CER files are security files provided and generated by an Certificate Authority. These files help a browser to verify if a website is secure and save to enter, verifying its authenticity.

What is the difference between a .cer and .pem certificate? ›

PEM = The PEM extension is used for different types of X. 509v3 files which contain ASCII (Base64) armored data prefixed with a “—– BEGIN …” line. CER = alternate form of . crt (Microsoft Convention) You can use MS to convert .

Can I use certificate without private key? ›

If you lose your private key, you will be unable to install your SSL certificate and will need to generate a new key pair (CSR + Private Key) and re-issue the certificate. You can find instructions on how to re-issue your certificate here. What happens if my Private Key is compromised?

Top Articles
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 6641

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.