openssl ec: Inspect and Convert EC Keys
openssl ec processes elliptic-curve keys, the way the rsa command processes RSA keys.
EC keys are small and fast, common for JWT signing and modern TLS. ec inspects and converts them.
What it does
openssl ec reads an EC private or public key and re-emits it, optionally extracting the public key (-pubout), printing parameters (-text), or changing the point conversion form (-conv_form).
Common usage
Terminal
openssl ec -in ec.pem -text -noout
openssl ec -in ec.pem -pubout -out ec-pub.pem
openssl ec -in ec.pem -conv_form compressed -out ec-compressed.pemOptions
| Flag | What it does |
|---|---|
| -pubout | Output the public key |
| -text | Print the key and curve details |
| -noout | Suppress the encoded key |
| -conv_form <form> | Point form: compressed, uncompressed, hybrid |
| -passin pass:<x> | Passphrase for an encrypted key |
Common errors in CI
"unable to load Key" on a key generated by genpkey can happen if it was written as PKCS#8 and the consuming tool wants the SEC1 EC PRIVATE KEY header; re-emit with openssl ec to get the EC-specific header. "error:..:EC_GROUP_new_by_curve_name" means an unknown or disabled curve.
Related guides
openssl ecparam: EC Parameters and Key Genopenssl ecparam lists curves and generates EC keys the classic way. Reference for -list_curves, -name, -genke…
openssl genpkey: Modern Private Key Generationopenssl genpkey is the modern, algorithm-agnostic way to generate private keys (RSA, EC, Ed25519). Reference…
openssl pkey: Inspect Any Private Keyopenssl pkey is the algorithm-agnostic key tool for RSA, EC, and Ed25519. Reference for -pubout, -text, -chec…
openssl dgst -sign: Sign and Verify Dataopenssl dgst -sign and -verify produce and check digital signatures with a private/public key. Reference for…