Saltar al contenido
ecdsa.com

Constructor de comandos OpenSSL online

Elige una tarea, rellena los huecos y copia un comando que funciona, con la explicación de cada una de sus opciones. O pega un comando que hayas encontrado en cualquier parte y obtén su desglose.

100 % local: el catálogo son datos estáticos y el analizador se ejecuta en tu navegador; nada de lo que escribes se envía a ninguna parte

Claves

Generar una clave privada EC

La forma moderna, con un solo comando. Escribe una clave privada PKCS#8 que Node.js, Go, Python, Java y WebCrypto cargan sin conversión.

Parámetros

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

Qué hace cada opción

openssl genpkey
El generador de claves de OpenSSL 3.x. Un solo comando sirve para todos los algoritmos y siempre escribe el contenedor PKCS#8: `-----BEGIN PRIVATE KEY-----`.
-algorithm EC
Genera una clave de curva elíptica. La curva concreta se indica con -pkeyopt.
-pkeyopt ec_paramgen_curve:P-256
Opción específica del algoritmo: genera la clave sobre la curva P-256. Sin ella, openssl no tiene ninguna curva con la que trabajar y se niega a continuar.
-out key.pem
Dónde escribir la clave. Si la quitas, la clave sale por la terminal: cómodo para echar un vistazo, pésimo para cualquier otra cosa.

Notas

  • El archivo de la clave privada ya contiene la clave pública. No necesitas guardar la parte pública por separado, salvo que otra persona tenga que leerla.
  • P-256, prime256v1 y secp256r1 son tres nombres de una misma curva. secp256k1 es una curva realmente distinta, no un cuarto alias: elígela solo si trabajas con Bitcoin o Ethereum.
  • El antiguo `openssl ecparam -name prime256v1 -genkey -noout -out key.pem` sigue funcionando y produce el mismo material de clave, pero en el contenedor SEC1 (`BEGIN EC PRIVATE KEY`). WebCrypto y varias vías de carga de la JVM solo aceptan PKCS#8.
  • Nada de esto cambia los permisos del archivo. En un equipo compartido, aplica después `chmod 600` a la clave.
Diferencias entre versiones. `genpkey` y los nombres NIST de las curvas funcionan igual en 1.1.1 y 3.x. Qué curvas existen depende de cómo se compiló el binario: `openssl ecparam -list_curves` te da la respuesta local.

Receta paso a paso: la misma tarea como guía probada, con la salida de cada comando explicada.

Tareas relacionadas

Cada comando del catálogo se generó con sus parámetros predeterminados y se ejecutó con OpenSSL 3.6.3 (9 Jun 2026), darwin64-arm64 antes de publicarse. Las opciones sí cambian entre versiones: cuando 1.1.1 y 3.x difieren, la tarea lo indica.

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.