Skip to content

CSR decoder

Paste a certificate signing request to check its subject, public key and requested names before you send it to a certificate authority.

Runs in your browser. Nothing you paste is sent to us.

Request

A sample request for auth.example.com is filled in. Paste yours; it stays in your browser.

This reads the request. It does not check the request’s signature.

Decoded

PKCS#10 v1 RSA, 2048 bits

Subject
C=US, ST=California, O=Example Corp, OU=Sample certificate, not real, CN=auth.example.com
Public key
RSA, 2048 bitsExponent 65537
Signature algorithm
sha256WithRSAEncryption1.2.840.113549.1.1.11

Requested extensions

Subject alternative names
DNS:auth.example.comDNS:login.example.comIP:192.0.2.10
Key usage
Digital signatureKey encipherment
Extended key usage
TLS server authentication (serverAuth) (1.3.6.1.5.5.7.3.1)
Public key (PEM)
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzHZIWJTQtoqNPb8rIZ3F
JXyR/djxqX4j0o7deufi8zjftkess6qmxhLdhrPQorWnDTX35MAJyEC/x86ytN1m
qSSZaVmH5eOTaBP6RTlg/XIligXnIBopE4XHSxcndKuApGmllf65K2xlG0AiJqm/
igtvXIg0G9TdpzCCLproDOUc2hmn7lPmYa9myQycv/ABjdo79zi6n5LF9yd2YrcO
X6Y4hBLIfwUyvb/KMNWu31QPqZJLPdv0NTlrsiAj1zhv7EYe2QRWWLptOFm1kVZJ
uKATKhEYXtlA+FtybhJDJpRiwXOwMVoV4f/0ERFtEkXsTaEGTPVg1S07HG26wjjn
hQIDAQAB
-----END PUBLIC KEY-----

How to use it

  1. Paste the PEM request (BEGIN CERTIFICATE REQUEST).
  2. Check the subject and the key type and size.
  3. Check the subject alternative names list every host name you need.
  4. Fix anything wrong and make a new request before ordering.

What to know

A CSR (PKCS#10) holds the public key, the names you want and a signature made with the matching private key. It holds no secret, so it is safe to share with the authority.

Certificate authorities and browsers use the subject alternative names, so a request with only a common name may come back without the names you expected.

For a Keycloak host, request every name users will see, such as the public host name and any separate admin host name.

What a certificate signing request is

A certificate signing request (CSR) is what you send to a certificate authority (CA) to get a certificate. It holds your public key, the names you want the certificate to cover, and a signature made with the matching private key. The signature proves you hold that private key.

The format is PKCS#10, defined in RFC 2986. Like certificates, CSRs are DER-encoded and usually shared as PEM between BEGIN CERTIFICATE REQUEST and END CERTIFICATE REQUEST lines. Some older tools write NEW CERTIFICATE REQUEST; this decoder reads both.

A CSR contains no secret. It is safe to send to a CA, paste into a ticket or decode here. The private key stays with you.

What is inside a CSR

PartWhat it holdsWhy it matters
VersionAlways 0, shown as version 1Nothing to check
SubjectA distinguished name, such as C=US, O=Example Corp, CN=auth.example.comMany public CAs ignore most of it for domain-validated certificates
Public keyThe key type and size or curveDecides the certificate’s key; it cannot change later
AttributesExtra data, mainly the extension requestHolds the names and usages you ask for
SignatureMade with the private key, usually with SHA-256Proves possession of the key

The extension request attribute carries the extensions you want in the certificate, most importantly subject alternative names (SAN). It can also ask for key usage and extended key usage. The CA decides what it actually issues; a request is only a request.

Why subject alternative names are the key check

Browsers and modern TLS clients match the host name only against the SAN extension. The common name in the subject is ignored. A certificate for auth.example.com with that name only in the CN will fail in browsers.

Public CAs that follow the CA/Browser Forum’s rules always put names in the SAN extension, and many copy the CN there for you. Private CAs, internal tools and older scripts often do not. Checking the CSR for a SAN before you submit it saves a round trip.

Creating a key and a CSR with SANs (OpenSSL 1.1.1 or later)
openssl req -new -newkey rsa:2048 -nodes \
  -keyout auth.example.com.key -out auth.example.com.csr \
  -subj "/CN=auth.example.com" \
  -addext "subjectAltName=DNS:auth.example.com,DNS:login.example.com"

What this decoder does and does not do

  • It reads a PEM CSR, or its bare Base64, and decodes the subject, public key, signature algorithm, requested extensions and other attributes.
  • It warns when no SAN is requested, when an RSA key is shorter than 2048 bits, and when the signature uses SHA-1 or MD5.
  • It extracts the public key as PEM, which you can compare with the key you expect.
  • It does not verify the CSR’s signature. The CA does that when you submit it.
  • It does not create CSRs or keys. Use OpenSSL or your server’s tooling for that, so the private key never leaves the server.

How to check a CSR before ordering

  1. Paste the PEM request. A sample request for auth.example.com is filled in to start with.
  2. Check the subject. For a public certificate, the CN should be one of your host names; organization fields matter only for organization-validated certificates.
  3. Check the public key: RSA 2048 or larger, or EC P-256 or P-384.
  4. Check the requested subject alternative names list every host name the certificate must cover.
  5. If anything is wrong, generate a new CSR. A CSR cannot be edited, because the signature covers all of it.

Planning names for an identity server

An identity server often has more names than people expect. Before generating a CSR for one, list them.

The public host name

This is the name users see on the sign-in page and that appears in token issuers, such as auth.example.com. In Keycloak it is set with the hostname option. It must be in the certificate.

A separate admin host name

Keycloak can serve the admin console on a different host name with the hostname-admin option, often reachable only from an internal network. If that host is served over TLS with the same certificate, its name belongs in the SAN list too.

Old names during a migration

When moving an identity server to a new domain, the certificate may need to cover both the old and new names for a while, so redirects and old links keep working without warnings.

Wildcards

A wildcard such as *.example.com covers one level of subdomains, so auth.example.com but not a.b.example.com and not example.com itself. Wildcards are convenient but spread one private key across many services; a certificate per service limits the damage if a key leaks.

Choosing the key for a CSR

KeyNotes
RSA 2048Works everywhere. The accepted minimum.
RSA 3072 or 4096Longer margin; slightly slower TLS handshakes.
EC P-256Smaller and faster; supported by all current clients.
EC P-384For policies that require 192-bit strength.

Generate a new key for each certificate request rather than reusing an old key. Renewal is a natural moment to rotate.

Common CSR mistakes

  • No SAN extension, so browsers reject the certificate.
  • A typo in a host name. The CA issues exactly what you asked for.
  • Losing the private key after sending the CSR. The certificate is useless without it; you must start again.
  • Generating the key and CSR on a laptop and copying the key to the server, instead of generating on the server.
  • Putting a challenge password in the CSR and thinking it protects the key. It does not; it is a legacy attribute some CAs used for revocation requests.
  • Using SHA-1 for the CSR signature with very old tools.

Security notes

The CSR is public, but the private key it was made with is the most sensitive file in the process. Create it on the machine that will use it, restrict its file permissions, and never email it or paste it anywhere.

If a CSR or certificate was issued for the wrong names, do not use it. Request a correct one; for a public certificate, consider revoking the wrong one.

For automated renewals, ACME clients such as those used with Let’s Encrypt create a fresh key and CSR for you each time. That is the simplest way to keep up with ever shorter certificate lifetimes.

Best practices

  • Generate keys and CSRs on the server that will use them.
  • Always include every host name as a SAN, even if it repeats the CN.
  • Use RSA 2048 or larger, or EC P-256, with a SHA-256 signature.
  • Decode every CSR before you submit it.
  • Automate issuance and renewal where the CA supports ACME.

After the certificate arrives

The CA returns a certificate, usually with one or more intermediate certificates. A few checks before installing it save an outage.

  1. Decode the certificate with the certificate decoder and confirm the names and validity.
  2. Confirm it matches your private key: the public key in the certificate must equal the one in your CSR.
  3. Build the chain file: your certificate first, then the intermediates in order.
  4. Install the certificate, chain and key, reload the server, and test with a browser and with openssl s_client.
  5. Put the expiry date in your monitoring.
Checking a certificate matches its private key
# These two lines must print the same hash
openssl x509 -in cert.pem -noout -pubkey | openssl sha256
openssl pkey -in private.key -pubout | openssl sha256
Questions

Frequently asked questions

What is a CSR file?

A certificate signing request: your public key and the names you want, signed with your private key, in PKCS#10 format. You send it to a certificate authority, which returns a signed certificate.

Does a CSR contain the private key?

No. It contains only the public key and a signature made with the private key. Keep the private key you made it with; the certificate is useless without it.

How do I add subject alternative names to a CSR?

With OpenSSL 1.1.1 or later, add -addext "subjectAltName=DNS:auth.example.com,DNS:www.example.com" to openssl req. With older versions, put the names in a config file’s request extensions section.

Can I edit a CSR after creating it?

No. The signature covers the whole request, so any change would invalidate it. Generate a new CSR with the right details; you can reuse the same key if you must.

Is the CN still required in a CSR?

Browsers ignore it for host name checks, and some CAs accept requests without one. Many tools and CAs still expect a CN, so set it to your main host name and list every name as a SAN too.

How do I decode a CSR on the command line?

Run openssl req -in request.csr -noout -text. It shows the same subject, key and requested extensions as this decoder.

Which key size should I use in a CSR?

RSA 2048 bits is the minimum and works everywhere. EC P-256 is smaller and faster and supported by all current clients. Use larger sizes only if a policy requires them.

Does this tool check the CSR signature?

No. It decodes the request. The certificate authority verifies the signature when you submit the CSR.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.