A PEM-encoded certificate is a text representation of an X.509 certificate. It uses ASCII characters, a Base64-encoded certificate body, and delimiter lines that identify the object. This makes certificates practical to store in text configuration files. section 8.1.2 section 8.4
Recognizing a PEM certificate
A PEM certificate begins with -----BEGIN CERTIFICATE----- and ends with -----END CERTIFICATE-----. The content between them is Base64 data. A GitHub certificate can be saved as github-cert.pem by piping OpenSSL output into openssl x509. section 8.1.2
echo | openssl s_client -servername github.com -connect github.com:443 2>/dev/null | openssl x509 > github-cert.pem
Inspect the command pipeline that opens a TLS connection, extracts its X.509 certificate, and writes the PEM representation. section 8.1.2
PEM describes how certificate data is represented, not what the certificate proves. The certificate still contains a public key and identity metadata; DER provides a binary alternative, while PKCS#12 can store multiple certificates and keys. section 8.4 section 8.1.4
