ITInfoByte

Key Pair & CSR Generator

Create a private key, its public key in PEM and OpenSSH form, and a CSR to send to a certificate authority. Keys are made by your browser's built-in Web Crypto API and the CSR is assembled and signed on this page, so the private key is never sent anywhere. You can also paste a private key you already have to make a CSR for it.

Runs locally — nothing you enter is sent Security Free · no signup

How to use

  1. Choose a key type. RSA 2048 works everywhere; ECDSA P-256 is smaller and faster and is accepted by every major certificate authority. RSA 4096 can take several seconds to generate.
  2. For a certificate, leave Also create a CSR ticked and fill in the Common Name (usually the main host name) and the subject alternative names: every host name and IP address the certificate must cover. The Country must be a two-letter code such as US or GB.
  3. Optionally type an SSH comment (shown at the end of the OpenSSH public key) and a passphrase to encrypt the private key.
  4. Click Generate key pair. Download or copy the private key straight away and store it safely: it exists only in this page and is gone when you close it.
  5. Send the CSR to your certificate authority, add the OpenSSH public key to ~/.ssh/authorized_keys, or use the public key PEM wherever one is asked for. The equivalent openssl and ssh-keygen commands are shown for reference.
  6. Already have a key? Choose Use my existing private key, paste it, fill in the subject and click Create CSR.

Examples

OpenSSH public key line (ECDSA P-256, shortened)
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBB… you@laptop
Fingerprint as shown by ssh-keygen -lf (illustrative value)
256 SHA256:pWm0cpaG8X1Ilw1cDUxszqBnu6Xa6ZRupmYnnGtQ0R0 you@laptop (ECDSA)
Check a CSR with OpenSSL
openssl req -in www.example.com.csr -noout -text -verify
Equivalent OpenSSL command for a P-256 key and CSR with SANs
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out www.key
openssl req -new -key www.key -sha256 -subj '/C=US/O=Example Inc/CN=www.example.com' \
  -addext 'subjectAltName=DNS:www.example.com,DNS:example.com' -out www.csr

Supported formats

  • Private key: PKCS#8 PEM (a BEGIN PRIVATE KEY block), or with a passphrase encrypted PKCS#8 (a BEGIN ENCRYPTED PRIVATE KEY block) using PBKDF2-HMAC-SHA256 with 600,000 iterations and AES-256-CBC.
  • Public key: X.509 SubjectPublicKeyInfo PEM (-----BEGIN PUBLIC KEY-----) and the OpenSSH one-line format (ssh-rsa, ecdsa-sha2-nistp256/384/521 or ssh-ed25519) with its SHA256: fingerprint as ssh-keygen -l prints it.
  • CSR: PKCS#10 PEM (-----BEGIN CERTIFICATE REQUEST-----) with subject fields C, ST, L, O, OU, CN and emailAddress, and a subjectAltName extension request for DNS names (wildcards allowed) and IPv4/IPv6 addresses. Signed with SHA-256 for RSA, SHA-256/384/512 for ECDSA P-256/P-384/P-521, or Ed25519.
  • Existing keys: unencrypted PKCS#8, PKCS#1 (BEGIN RSA PRIVATE KEY) and SEC1 (BEGIN EC PRIVATE KEY) PEM, for RSA 2048+ and the P-256, P-384 and P-521 curves, plus Ed25519 where the browser supports it.

Privacy

This tool runs entirely in your browser. Nothing you enter or open is sent anywhere. Privacy policy.

Limitations

  • OpenSSH's own private key format (the BEGIN OPENSSH PRIVATE KEY block) is not produced. Current OpenSSH reads the PKCS#8 file directly (ssh -i private.key, ssh-keygen -y -f private.key) for RSA, ECDSA and, in recent versions, Ed25519; run ssh-keygen -p -f on the file to rewrite it in OpenSSH format if you prefer.
  • Ed25519 appears only if your browser's Web Crypto supports it (recent Chrome, Edge, Firefox and Safari do). Few public certificate authorities issue TLS certificates for Ed25519 keys, so use RSA or ECDSA for a web server CSR.
  • RSA keys use the public exponent 65537 and the CSR is signed with SHA-256; other exponents and RSA-PSS are not offered.
  • Internationalised domain names must be entered in their punycode form (xn--…). Only DNS and IP subject alternative names are supported, not email, URI or other name types, and no other CSR extensions are added.
  • Encrypted private keys cannot be pasted in to make a CSR; decrypt a copy first. OpenSSH-format private keys cannot be pasted either.
  • Key generation quality depends on your browser and device. The page keeps nothing, so if you lose the private key you need a new key and a new certificate.

FAQ

Is it safe to generate a private key in a browser?

The key is created by your browser's Web Crypto API, which uses the operating system's secure random generator, and the page makes no network request with it. The main risks are on your side of the screen: browser extensions that can read pages, and where you save the file. For a production server, generating the key on that server with openssl means the private key never exists anywhere else, which is often the better choice. The equivalent commands are shown under the result.

RSA or ECDSA — which should I choose?

Both are accepted by all major certificate authorities. ECDSA P-256 gives equivalent security to RSA 3072 with much smaller keys and faster TLS handshakes. RSA 2048 has the widest compatibility with very old clients and some appliances. If you are unsure, P-256 is a good default for a web server and RSA 2048 for anything older.

Why do I need subject alternative names when I have a Common Name?

Browsers have ignored the Common Name for host name checks for years and only look at the subject alternative names. Certificate authorities copy the names you need into the SAN list anyway, but listing them in the CSR keeps the request self-describing. The option to add the Common Name to the SANs is on by default.

Can I use the private key with SSH?

Yes. The OpenSSH public key goes into ~/.ssh/authorized_keys on the server, and current OpenSSH can use the PKCS#8 private key file directly with ssh -i. If you want OpenSSH's own private key format, run ssh-keygen -p -f on the file, which also lets you set a passphrase. Keep the file readable only by you (chmod 600), or ssh refuses to use it.

What does the passphrase option do?

It encrypts the private key file with a key derived from your passphrase (PBKDF2-SHA256, 600,000 iterations, AES-256-CBC) in the standard encrypted PKCS#8 format, so openssl, nginx with ssl_password_file, Node.js and OpenSSH can read it with the passphrase. Many web servers cannot prompt for a passphrase at start-up, so server keys are often left unencrypted and protected by file permissions instead.

How do I check the CSR before sending it?

Run openssl req -in request.csr -noout -text -verify, which checks the signature and prints the subject and SANs, or paste the CSR into a CSR decoder. The SSL Certificate Decoder on this site recognises CSRs and shows the requested subject and key type.