toolqik

43 · Keys & Auth

PEM Decoder

Identify any PEM file and explore its ASN.1 structure.

Runs in your browser

About this tool

PEM is the text wrapper used for almost everything in TLS and SSH: certificates, certificate requests, public keys, private keys, parameters and chains. Inside each -----BEGIN …----- block is Base64-encoded DER, a binary ASN.1 structure. This decoder tells you what each block is, summarises it, and shows its complete ASN.1 tree with object identifiers translated to names.

Decoding runs entirely in your browser. Even so, avoid pasting private keys into websites; use the Private Key Inspector only with keys you can afford to rotate.

Common PEM types

HeaderContains
CERTIFICATEAn X.509 certificate (.crt, .cer, .pem)
CERTIFICATE REQUESTA CSR (.csr) to send to a certificate authority
PUBLIC KEYAny public key, SubjectPublicKeyInfo format
PRIVATE KEYAny private key, PKCS#8 format
ENCRYPTED PRIVATE KEYA passphrase-protected PKCS#8 private key
RSA PRIVATE KEY, EC PRIVATE KEYOlder algorithm-specific private key formats (PKCS#1, SEC1)
OPENSSH PRIVATE KEYAn SSH private key (not ASN.1)

Reading the ASN.1 tree

Each line shows a type (such as SEQUENCE, INTEGER or OBJECT IDENTIFIER) and its length in bytes. OIDs are shown with their names, such as 1.2.840.113549.1.1.11 (SHA-256 with RSA); strings and dates are decoded. Bit and octet strings that contain more ASN.1, like the public key inside a certificate, are expanded too. It’s the same information as openssl asn1parse, in a browsable form.

FAQ

What is a PEM file?

A text file containing Base64-encoded binary data between -----BEGIN and -----END lines. It is the usual format for certificates and keys.

What is the difference between PEM and DER?

DER is the binary ASN.1 encoding; PEM is the same bytes Base64-encoded with header lines, so it can be copied as text.

How do I convert DER to PEM?

Run openssl x509 -inform der -in cert.der -out cert.pem, or open the .der file on this page, which converts it automatically.

What is ASN.1?

Abstract Syntax Notation One, the language used to define the structure of certificates, keys and many protocols. DER is its binary encoding.

esc
↑↓ navigate↵ open