SSL has been around for long enough you’d think that there would be agreed upon container formats. And you’re right, there are. But it’s too many. First, we will look at formats that show up from time to time, like in a lot of places
Frequently seen extensions
|Certificate Signing Request||
||Some applications can generate these for submission to certificate-authorities. The actual format is PKCS10 which is defined in RFC 2986. It includes some/all of the key details of the requested certificate such as subject, organization, state, whatnot, as well as the public key of the certificate to get signed. These get signed by the CA and a certificate is returned. The returned certificate is the public certificate (which includes the public key but not the private key), which itself can be in a couple of formats.|
|Base64 Encoded Certificate File||
||Defined in RFCs 1421 through 1424, this is a container format that may include just the public certificate (such as with Apache installs, and CA certificate files
|Private Key File||
||This is a PEM formatted file containing just the private-key of a specific certificate and is merely a conventional name and not a standardized one. In Apache installs, this frequently resides in /etc/ssl/private. The rights on these files are very important, and some programs will refuse to load these certificates if they are set wrong.|
|Public-Key Cryptography Standards (PKCS)||
||Originally defined by RSA in the Public-Key Cryptography Standards (abbreviated PKCS), the “12” variant was originally enhanced by Microsoft, and later submitted as RFC 7292. This is a password-protected container format that contains both public and private certificate pairs. Unlike
|Plain Certificate File||
||A way to encode ASN.1 syntax in binary, a .pem file is just a Base64 encoded
|Base64 Encoded Certificate File (for Windows)||
|Certificate Interchange File (for Windows)||
||Defined in RFC 2315 as PKCS number 7, this is a format used by Windows for certificate interchange. Java understands these natively, and often uses
Certificate revocation list -
Certificate Authorities produce these as a way to de-authorize certificates before expiration. You can sometimes download them from CA websites. In summary, there are four different ways to present certificates and their components:
PEM- Governed by RFCs, its used preferentially by open-source software. It can have a variety of extensions (
PKCS7- An open standard used by Java and supported by Windows. Does not contain private key material.
PKCS12- A Microsoft private standard that was later defined in an RFC that provides enhanced security versus the plain-text PEM format. This can contain private key material. Its used preferentially by Windows systems, and can be freely converted to PEM format through use of openssl.
DER- The parent format of PEM. It’s useful to think of it as a binary version of the base64-encoded PEM file. Not routinely used very much outside of Windows.
Hope this helps.