Construtor de comandos OpenSSL (OpenSSL Command Builder)
Escolha uma tarefa, preencha os campos, copie um comando que funciona — e veja cada flag dele explicada. Ou cole um comando que você encontrou por aí e veja-o destrinchado para você.
100% local — o catálogo é composto de dados estáticos e o parser roda no seu navegador; nada do que você digita é enviado a lugar algum
Chaves
Gerar uma chave privada EC
A forma moderna, com um único comando. Grava uma chave privada PKCS#8 que Node.js, Go, Python, Java e WebCrypto carregam sem conversão.
Parâmetros
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out key.pemO que cada flag faz
- openssl genpkey
- O gerador de chaves do OpenSSL 3.x. Um único comando cobre todos os algoritmos, e ele sempre grava o contêiner PKCS#8 — `-----BEGIN PRIVATE KEY-----`.
- -algorithm EC
- Gera uma chave de curva elíptica. A curva em si vem de -pkeyopt.
- -pkeyopt ec_paramgen_curve:P-256
- Opção específica do algoritmo: gera a chave na curva P-256. Sem ela, o openssl não tem curva com que trabalhar e se recusa a continuar.
- -out key.pem
- Onde gravar a chave. Sem esta opção, a chave vai para o terminal — prático para dar uma olhada, péssimo para qualquer outra coisa.
Observações
- O arquivo da chave privada já contém a chave pública. Você nunca precisa salvar a parte pública separadamente, a menos que outra pessoa precise lê-la.
- P-256, prime256v1 e secp256r1 são três nomes da mesma curva. A secp256k1 é uma curva realmente diferente, e não um quarto apelido — escolha-a só se estiver trabalhando com Bitcoin ou Ethereum.
- O comando antigo `openssl ecparam -name prime256v1 -genkey -noout -out key.pem` ainda funciona e produz o mesmo material de chave, mas no contêiner SEC1 (`BEGIN EC PRIVATE KEY`). O WebCrypto e vários caminhos da JVM só aceitam PKCS#8.
- Nada aqui altera as permissões do arquivo. Em uma máquina compartilhada, execute em seguida `chmod 600` na chave.
Receita passo a passo — a mesma tarefa como um passo a passo testado, com a saída de cada comando explicada.
Tarefas relacionadas
Cada comando do catálogo foi gerado com os parâmetros padrão e executado no OpenSSL 3.6.3 (9 Jun 2026), darwin64-arm64 antes da publicação. As opções de fato mudam entre versões — onde 1.1.1 e 3.x diferem, a tarefa avisa.
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.