Skip to main content
Tool Factory
  • English
  • Español · Review pending
  • Français · Review pending
  • Deutsch · Review pending
  • Português · Review pending
  • 日本語 · Review pending
  • 简体中文 · Review pending

Key and certificate formats: identify the container before converting

Distinguish PEM, DER, PKCS#1, PKCS#8, SPKI, X.509, CSR, JWK, and OpenSSH formats with public test examples.

Identify the container before choosing a converter. PEM and DER describe encoding layers; they do not identify a key's purpose. A certificate contains a public key, but a public key alone contains no certificate identity. Renaming a file or replacing its BEGIN label cannot convert its internal structure.

Never paste a production private key into any web page, including ours. Use public material or disposable test keys for format experiments. A browser processing claim does not establish trust in every script, extension, clipboard manager, or device. Treat a production private key pasted into any web page, including ours, as a key incident. Replace the exposed key and revoke affected credentials under your incident procedure.

Recognize the wrapper, then inspect the structure

File extensions such as .pem, .der, .crt, and .key provide hints, not proof. Use this table before deleting headers or decoding Base64. The Visible clue column lists labels, text patterns, or binary structure hints.

Recognition clues and the structure each format carries
FormatVisible clueWhat to confirm
PEMBEGIN and END boundaries around Base64Read the label and decode the body. PEM alone specifies neither the algorithm nor trust.
DERBinary ASN.1 data, often a SEQUENCECheck tags, lengths, and the expected schema. DER encodes many structures beyond certificates.
PKCS#1RSA PRIVATE KEY or RSA PUBLIC KEYUnencrypted PKCS#1 data contains RSA integers. The public form contains modulus and exponent.
PKCS#8PRIVATE KEY or ENCRYPTED PRIVATE KEYAn algorithm identifier accompanies private key data. The encrypted form wraps encrypted private key information.
SPKIPUBLIC KEYSubjectPublicKeyInfo combines an algorithm identifier with public key bits.
X.509CERTIFICATEExpect issuer, subject, validity, public key, and signature fields. Parsing these fields does not validate trust.
CSRCERTIFICATE REQUESTPKCS#10 requests certification of a subject and public key. It carries attributes and the applicant's signature.
JWKA JSON object with ktyInspect the key type and its parameters. A JWK can contain public, private, or symmetric key material.
OpenSSH public keyssh-rsa or ssh-ed25519 before Base64The decoded SSH blob uses length-prefixed fields. An optional comment follows the public key.
OpenSSH private keyOPENSSH PRIVATE KEYThe decoded body uses the OpenSSH private container. It is not a PKCS#8 DER structure.

Legacy OpenSSL encryption can retain the RSA PRIVATE KEY label with Proc-Type and DEK-Info headers. OpenSSL documents this encrypted format. Its Base64 body decodes to ciphertext, not readable RSA integers. RFC 7468 does not permit these legacy headers. Our PEM to hex converter does not support them.

RFC 7468's label guide maps certificate, request, and key labels to ASN.1 structures. Its textual encodings permit BER in several cases, with DER preferred. Therefore, Base64 inside PEM does not automatically prove canonical DER. ITU X.690 defines DER encoding rules.

Separate RSA integers from their containers

RFC 8017, appendix A.1 defines PKCS#1 RSA structures. Its public structure contains two integers: modulus n and public exponent e. Its private structure adds private values needed for RSA operations. Neither structure includes a certificate subject or issuer.

PKCS#8 adds an algorithm identifier around private key data. RFC 5958, section 2 extends the earlier PrivateKeyInfo structure with optional public key data. An RSA PKCS#8 structure can contain a PKCS#1 private structure inside its privateKey field. Changing the outer label leaves that extra structure untouched.

SPKI performs a different job: it identifies an algorithm and carries public key bits. RFC 5280, section 4.1 defines this structure within certificates. An RSA SPKI contains the PKCS#1 public structure inside a BIT STRING. A standalone PUBLIC KEY block lacks the surrounding certificate's identity and issuer signature.

Follow one toy public key from JWK to DER

The following deliberately tiny RSA public values teach container recognition. They provide no usable cryptographic security. Paste this object into the JWK to PEM converter. No private parameter appears in this example.

{"kty":"RSA","n":"DKE","e":"EQ"}

RFC 7517, section 4 defines JWK members, including the required key type. RFC 7518, section 6.3.1 defines RSA modulus and exponent as Base64urlUInt strings. Here, DKE represents modulus 3233; EQ represents exponent 17. These strings encode integers, not decimal text or encrypted values.

-----BEGIN PUBLIC KEY-----
MBswDQYJKoZIhvcNAQEBBQADCgAwBwICDKECARE=
-----END PUBLIC KEY-----

The converter returns a PUBLIC KEY block: SPKI, not a certificate or private key. Paste that block into the PEM to hex converter. It returns these bytes, with no certificate issuer or subject added:

301b300d06092a864886f70d0101010500030a00300702020ca1020111

The final 300702020ca1020111 bytes form the nested PKCS#1 public structure. Its INTEGER values are 0ca1 and 11, which match 3233 and 17. The preceding SPKI fields identify RSA and wrap those public integers. A successful hex conversion establishes bytes; it does not establish key strength or ownership.

Distinguish a request from an issued certificate

A CSR asks an issuer to certify a subject and public key. RFC 2986, section 4 defines its request information and signature. Use the CSR parser to inspect the subject, public key, signature details, and requested extensions. The parser reads those fields; it does not issue a certificate or establish approval of requested names.

A requested DNS name remains a request until the issuer validates it under its own rules. A certificate instead records an issuer's signed statement, with validity dates and other constraints. Trust evaluation also needs a certification path and applicable checks. Do not substitute a readable CSR report for certificate validation.

Read SSH lengths instead of ASN.1 tags

Enter this matching toy public key in the SSH host key parser with Auto input. It carries the same RSA integers in an SSH blob:

ssh-rsa AAAAB3NzaC1yc2EAAAABEQAAAAIMoQ== format-example
Key type: ssh-rsa
Exponent: 0x11
Modulus: 0x0ca1

RFC 4253, section 6.6 places the SSH key type before the exponent and modulus. That field order differs from the PKCS#1 public structure. The trailing comment does not authenticate a host. Confirm a real host's fingerprint through a separate trusted channel.

OpenSSH's public key line documentation describes the type, Base64 data, and comment. OpenSSH private files use the separate OpenSSH private key format. Their decoded body starts with the openssh-key-v1 marker and a NUL byte. A PRIVATE KEY label from PKCS#8 cannot replace that container.

Know what each browser operation proves

The RSA key pair generator creates new keys rather than converting an existing certificate. With 2048 bits and PEM output, it returns PUBLIC KEY and RSA PRIVATE KEY blocks. Those labels mean SPKI public data and PKCS#1 private data. Generate disposable test material here; generate operational keys inside your controlled key management environment.

The RSA verifier checks message bytes against a signature and supplied public key. It uses PKCS#1 v1.5 signature verification, not certificate path validation. Select the matching digest, message encoding, and signature encoding. A valid signature returns Verified OK; changing the signed message returns Verification Failure.

These six tools run their processing adapters in your browser without uploading pasted input for processing. They display decoded data, converted data, generated keys, or verification results in the page. Copy and download actions create additional copies. Page assets can still make network requests. Google Analytics loads automatically on production pages. Browser processing never changes the warning against pasting production private keys.

Common format mistakes

  • Do not call every PEM block a certificate. Read its boundary label before selecting a parser.
  • Do not treat Base64 as protection. Anyone can decode unencrypted private material from its Base64 text. Encrypted blocks require decryption to recover their private values.
  • Do not assume every JWK is public. RSA private members and symmetric secrets need private key handling.
  • Do not infer trust from matching RSA parameters. A copied public key proves no certificate identity or host ownership.