PEM encoded certificate

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{FormatInfo |formattype=electronic |subcat=Security |extensions={{ext|pem}}, {{ext|crt}}, {{ext|cer}} }} '''PEM encoded certificate''' is a file format for storing [[X.509 ce...")
 
(sample files)
 
(3 intermediate revisions by one user not shown)
Line 5: Line 5:
 
}}
 
}}
 
'''PEM encoded certificate''' is a file format for storing [[X.509 certificate|X.509 certificates]]. It is one of many [[PEM]] formats.
 
'''PEM encoded certificate''' is a file format for storing [[X.509 certificate|X.509 certificates]]. It is one of many [[PEM]] formats.
 +
 +
A certificate file should have a corresponding [[PEM encoded RSA private key|private key]] file.
  
 
== Format ==
 
== Format ==
Line 16: Line 18:
 
== Examples ==
 
== Examples ==
 
To display the contents of a PEM encoded certificate using OpenSSL:
 
To display the contents of a PEM encoded certificate using OpenSSL:
   openssl x509 -noout -text -in example.crt
+
   openssl x509 -noout -text -in example.pem
  
 
To convert from PEM encoded certificate format to [[DER encoded certificate]] format:
 
To convert from PEM encoded certificate format to [[DER encoded certificate]] format:
   openssl x509 -in example.crt -outform der -out example.der
+
   openssl x509 -in example.pem -outform der -out example.der
  
 
== Software ==
 
== Software ==
* [http://www.openssl.org/ OpenSSL]
+
* [[OpenSSL]]
 +
 
 +
== Sample files ==
 +
* {{DexvertSamples|text/pemCertificate}}

Latest revision as of 15:30, 30 July 2024

File Format
Name PEM encoded certificate
Ontology
Extension(s) .pem, .crt, .cer

PEM encoded certificate is a file format for storing X.509 certificates. It is one of many PEM formats.

A certificate file should have a corresponding private key file.

Contents

[edit] Format

A PEM encoded certificate is simply a base64-encoded DER encoded certificate file, with some delimiting lines added.

More than one certificate may be stored in a single file. There may also be other types of objects, such as private keys, stored in the same file.

[edit] Identification

A PEM encoded certificate file is plain text. It contains one or more pairs of "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" lines, with base64-encoded data between them.

[edit] Examples

To display the contents of a PEM encoded certificate using OpenSSL:

 openssl x509 -noout -text -in example.pem

To convert from PEM encoded certificate format to DER encoded certificate format:

 openssl x509 -in example.pem -outform der -out example.der

[edit] Software

[edit] Sample files

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox