Reputation: 4405
I just bought an SSL cert from my domain registrar.
They only provided me:
(no .key file)
I had to copy the plaintext from their webpage after they magically created the cert.
My SSL cert looks like:
-----BEGIN CERTIFICATE-----
MIIGJTCCBQ2gAwIBAgIQD5EJV21qWTH5W6AhivSAEzANBgkqhkiG9w0BAQsFADBZ
<more string>
-----END CERTIFICATE-----
Questions:
If I create a new "cert.pem" file and just paste the plaintext of my SSL cert in, is it fully pem encoded or do I have to further process it?
What if I create a new "cert.crt" file? Could I just paste the plaintext of my SSL cert in there as well without further encoding?
Could either file now be passed as a client cert in HTTPS requests?
Edit: As @Marc mentioned, I should have said "text" above rather than "plaintext". Aside from the headers, the cert is not in plaintext.
Upvotes: 1
Views: 2624
Reputation: 21105
What you call "plaintext" is PEM encoding, which is base-64 encoding of a DER (or BER or CER) file with extra headers.
.crt
is commonly used for PEM encoding. But the actual extension does not matter.
You can definitely use the shown certificate in your client (how to do so depends on the language used).
However, you will need the key. If you sent a CSR to them, the key should already be in your possession (you sent them the public key as part of the CSR, but the private key stayed with you). If you did not send them a CSR, they generated the key pair for you and should have a way to download the private key.
Upvotes: 3