Andri Setiawan

ssl

decode certificates and CSRs without uploading them anywhere

Certificate & CSR decoder

Paste a certificate, a whole chain, a CSR or a public key (PEM, the -----BEGIN ...----- kind), or open the file. It is decoded right here in your browser. This page is not even allowed to make network requests, so nothing you paste can leave it.

Does this certificate fit my private key?

The certificate key matcher on this page is a recipe, not a text box. You run it on your own server; the key stays exactly where it is.

Rule #1: a private key never goes into a website.

Not this one, not the shiny one with the friendly padlock, not the one your colleague swears by. A private key is like a toothbrush: personal, never shared, and nobody needs to see yours. Any page with a box for it is a page that could keep it, and you would never know.

Already pasted one somewhere? Treat that key as burned: make a new key and CSR, get the certificate reissued, and ask the CA to revoke the old one. Annoying, but much cheaper than the alternative.

1 · The quick check (works for RSA, ECDSA and Ed25519)

Print the public key that hides inside each file and compare. Same output means it is the same key pair.

on the server that holds the key
diff <(openssl pkey -in server.key -pubout) \
     <(openssl x509 -in server.crt -noout -pubkey) \
  && echo "match: this certificate belongs to this key" \
  || echo "no match"

2 · Compare by fingerprint (handy when the files live on different machines)

Each line prints a SHA-256 of the public key. The decoder above shows the same value as Public key SHA-256 for any certificate or CSR you paste, so you can compare with what step 2a prints for your key.

2a · private key (run where the key is)
openssl pkey -in server.key -pubout -outform DER | openssl sha256
2b · certificate
openssl x509 -in server.crt -noout -pubkey | openssl pkey -pubin -outform DER | openssl sha256
2c · CSR
openssl req -in server.csr -noout -pubkey | openssl pkey -pubin -outform DER | openssl sha256

3 · The old-school way (RSA keys only)

the two hashes must be equal
openssl x509 -noout -modulus -in server.crt | openssl sha256
openssl rsa  -noout -modulus -in server.key | openssl sha256

Key protected with a passphrase? openssl asks for it on your terminal, which is exactly where a passphrase belongs. Want to check a certificate and CSR against each other? Paste both into the decoder above: they are public, and it tells you whether their keys match.

More tools