b2KIT

PEM File Parser & Inspector

Parse PEM-encoded certificates, keys, and CSRs. Display algorithm, key size, subject, issuer, and validity details.

Tested tool guide Tested browser tools Checked August 16, 2026

What PEM File Parser & Inspector does, with a checked example

This tool takes one or more PEM blocks, strips the base64 body between the BEGIN/END markers, decodes it to DER, and walks the ASN.1 structure to surface subject, issuer, validity dates, signature algorithm, and public key type and size. It handles certificates, CSRs, and public/private keys as separate object types. The most common surprise: a chain file with several concatenated blocks is reported block by block, not merged into one certificate path, so users looking for 'the chain is valid' get individual field dumps instead.

Worked example

A concrete input and expected output from the current implementation.

Input

-----BEGIN CERTIFICATE-----
MIIB...
-----END RSA PRIVATE KEY-----

Expected output

Error: mismatched PEM boundaries - block opens with 'BEGIN CERTIFICATE' but closes with 'END RSA PRIVATE KEY'. No fields extracted.

PEM requires the BEGIN and END labels of a block to match (RFC 7468); a parser that enforces this cannot treat the base64 payload as either object type and must reject the block rather than guess.

How the result is produced

1

Decode then parse by schema

For each matched BEGIN/END pair the tool base64-decodes the body to raw DER, then walks the ASN.1 tag-length-value tree using the schema implied by the label: X.509 for CERTIFICATE, PKCS#10 for CERTIFICATE REQUEST, PKCS#1/PKCS#8/SEC1 for keys. Named fields (subject DN, validity, key parameters) are pulled from fixed positions in that schema rather than shown as raw hex.

2

Label-driven type routing

Because a PEM file only carries a plain-text label, the parser picks its extraction schema from that label before looking at the DER content. A block whose label doesn't match its actual contents (a private key saved under a CERTIFICATE header, for instance) will be parsed under the wrong assumptions and produce an error or garbled fields rather than being auto-corrected.

Good uses

  • Checking a downloaded TLS certificate's expiry date and issuer before installing it on a server, without running openssl x509 -text
  • Confirming a CSR's subject fields and key size match what was requested before submitting it to a CA
  • Verifying whether a private key file is RSA or EC, and what size or curve, when a service's requirements aren't documented

Limits and checks

  • The tool parses one PEM block's own fields; it does not validate a certificate chain against a trust store, check revocation (CRL/OCSP), or confirm a private key matches a given certificate
  • A multi-block chain file is shown as separate parsed blocks - the order and count in the file is not automatically checked against what a server actually needs (leaf, then intermediates, in the right order)
  • An encrypted private key (password-protected PKCS#8, or PEM with a DEK-Info header) can't be decrypted by a browser-only parser without the password, so its internal fields stay unreadable and only the encryption metadata is reported

Common questions

Can this tool tell me if my certificate chain is valid?

No. It reads the fields inside each PEM block you give it - subject, issuer, validity, algorithm - but it does not build or validate a trust path against a CA store and does not check revocation status. For chain validation, use a tool that performs that check explicitly, such as openssl verify.

Does it confirm my private key matches my certificate?

No, it parses one PEM input at a time and doesn't compare two files against each other. To check a match yourself, look at the public key details this tool reports for each file separately, or compare modulus/public key output the way openssl rsa -noout -modulus and openssl x509 -noout -modulus are typically compared.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools