ecdsa.com

OpenSSL Command Builder

Pick a task, fill in the blanks, copy a command that works — and get every flag in it explained. Or paste a command you found somewhere and have it taken apart for you.

100% local — the catalog is static data and the parser runs in your browser; nothing you type is sent anywhere

Keys

Generate an EC private key

The modern one-command form. Writes a PKCS#8 private key that Node.js, Go, Python, Java and WebCrypto all load without conversion.

Parameters

Command
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out key.pem

What each flag does

openssl genpkey
The OpenSSL 3.x key generator. One command covers every algorithm, and it always writes the PKCS#8 container — `-----BEGIN PRIVATE KEY-----`.
-algorithm EC
Generate an elliptic-curve key. The curve itself comes from -pkeyopt.
-pkeyopt ec_paramgen_curve:P-256
Algorithm-specific option: generate on the P-256 curve. Without it openssl has no curve to work with and refuses.
-out key.pem
Where to write the key. Drop this and the key goes to your terminal — convenient for a look, terrible for anything else.

Notes

  • The private key file already contains the public key. You never need to save the public part separately unless someone else has to read it.
  • P-256, prime256v1 and secp256r1 are three names for one curve. secp256k1 is a genuinely different curve, not a fourth alias — pick it only if you are working with Bitcoin or Ethereum.
  • The older `openssl ecparam -name prime256v1 -genkey -noout -out key.pem` still works and produces the same key material, but in the SEC1 container (`BEGIN EC PRIVATE KEY`). WebCrypto and several JVM paths only accept PKCS#8.
  • Nothing here touches the file's permissions. On a shared machine follow with `chmod 600` on the key.
Version differences. `genpkey` and the NIST curve spellings work identically on 1.1.1 and 3.x. Which curves exist at all depends on how the binary was built — `openssl ecparam -list_curves` is the local answer.

Related tasks

Every command in the catalog was generated with its default parameters and executed against OpenSSL 3.6.3 (9 Jun 2026), darwin64-arm64 before publication. Options do move between releases — where 1.1.1 and 3.x differ, the task says so.

How it works

openssl is not one program but roughly thirty, each with its own option set, and the manual page is organised around those programs rather than around what anyone is trying to do. The result is that “make a self-signed certificate with a SAN” lives under req, which is documented as the certificate request command, and that the flag which actually decides whether browsers accept your certificate — -addext — appears nowhere near the top. This page inverts that: 36 tasks phrased as goals, each producing a command whose every flag is spelled out underneath.

The explanations are the point. A command you copied and cannot read is a command you cannot adapt, and openssl’s flags are unusually easy to misread — -noout suppresses the object rather than all output, -nocrypt is the difference between a script that runs and one that hangs at a prompt, and -copy_extensions is why a certificate you issued yourself has no hostnames in it. Each task also lists the specific ways it goes wrong, because those are what actually costs the afternoon.

Values you type are quoted for a POSIX shell before they go into the command, so a path with spaces or a subject with a comma survives the copy-paste. If a value contains something a shell would normally act on — backticks, $( ), a semicolon — the builder says so, because the quoting means it will be passed through literally rather than executed, and that is occasionally the surprise rather than the reassurance. Windows users should note that cmd.exe and PowerShell quote differently; the commands here assume sh, bash or zsh.

The reverse mode splits a pasted command the way a shell would — respecting quotes, escapes, pipes and redirections — and looks each flag up in a dictionary covering 180 options across 24 subcommands. Nothing is executed, and a flag that is not in the dictionary is labelled unknown rather than given an invented meaning. For the authoritative list your build accepts, openssl <subcommand> -help is always right and always local.

Honesty about versions. Every command in the catalog was generated with its default parameters and executed against OpenSSL 3.6.3 (9 Jun 2026), darwin64-arm64, along with the parameter combinations that change the command shape. That is one binary on one platform. openssl options are added, renamed and removed between releases — -nodes became -noenc, -rawin and -copy_extensions arrived in 3.0, and old PKCS#12 algorithms moved behind the legacy provider — so where 1.1.1 and 3.x genuinely differ, the task carries a note saying which. If a command misbehaves on your machine, check openssl version first.