OpenSSL コマンドビルダー
タスクを選んで空欄を埋めれば、そのまま動くコマンドをコピーでき、含まれるすべてのフラグの解説も読めます。どこかで見つけたコマンドを貼り付けて、分解して解説させることもできます。
100% ローカル:カタログは静的データで、パーサーはブラウザー内で動作します。入力した内容がどこかに送信されることはありません
鍵
EC 秘密鍵を生成
単一のコマンドで済む現在の書き方です。Node.js、Go、Python、Java、WebCrypto のいずれも変換なしで読み込める PKCS#8 形式の秘密鍵を書き出します。
パラメーター
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out key.pem各フラグの役割
- openssl genpkey
- OpenSSL 3.x の鍵生成ツールです。単一のコマンドですべてのアルゴリズムに対応し、常に PKCS#8 コンテナー(`-----BEGIN PRIVATE KEY-----`)で書き出します。
- -algorithm EC
- 楕円曲線の鍵を生成します。曲線そのものは -pkeyopt で指定します。
- -pkeyopt ec_paramgen_curve:P-256
- アルゴリズム固有のオプション:P-256 曲線で生成します。これがないと openssl は使う曲線がわからず、処理を拒否します。
- -out key.pem
- 鍵の書き出し先です。省略すると鍵はターミナルに出力されます。中身をちょっと見るには便利ですが、それ以外の用途にはまったく向きません。
補足
- 秘密鍵ファイルには公開鍵がすでに含まれています。他の誰かが読む必要がない限り、公開鍵を別に保存する必要はありません。
- P-256、prime256v1、secp256r1 は、同じ曲線の 3 つの名前です。secp256k1 は 4 つ目の別名ではなく、まったく別の曲線です。Bitcoin や Ethereum を扱う場合にだけ選んでください。
- 従来の `openssl ecparam -name prime256v1 -genkey -noout -out key.pem` も引き続き使え、同じ鍵素材を生成しますが、形式は SEC1 コンテナー(`BEGIN EC PRIVATE KEY`)になります。WebCrypto や JVM の一部の読み込み経路は PKCS#8 しか受け付けません。
- ここではファイルのパーミッションは変更しません。共有マシンでは、続けて鍵ファイルに `chmod 600` を実行してください。
手順を追ったレシピ:同じタスクを動作確認済みの手順として、各コマンドの出力の解説付きで紹介しています。
関連するタスク
カタログのすべてのコマンドは、公開前にデフォルトのパラメーターで生成し、OpenSSL 3.6.3 (9 Jun 2026), darwin64-arm64 で実行して確認しています。オプションはリリース間で変わることがあります。1.1.1 と 3.x で違いがある場合は、タスクにその旨を記載しています。
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.