Skip to content
ecdsa.com

SEC 1 ECPrivateKey

The elliptic-curve private key structure from SEC 1 and RFC 5915, written by OpenSSL as -----BEGIN EC PRIVATE KEY-----, that stores the scalar with optional curve parameters and public point.
Also written asEC PRIVATE KEYECPrivateKeyRFC 5915SEC1

ECPrivateKey is a SEQUENCE of version 1, the private scalar as an OCTET STRING, optional [0] curve parameters and an optional [1] public key BIT STRING. The [0] field normally holds the named-curve OID; files written with explicit curve parameters (rare, and rejected by many libraries) carry the whole curve instead.

It is the elliptic-curve counterpart of the PKCS #1 RSA format: OpenSSL's openssl ecparam -genkey and openssl ec still output it, while openssl genpkey outputs PKCS #8, which embeds the same ECPrivateKey inside a PrivateKeyInfo and moves the curve OID into the algorithm parameters. Java and WebCrypto need PKCS #8.

The name also refers to the SEC 1 document itself (Standards for Efficient Cryptography, version 2, 2009), which defines ECDSA, ECDH, ECIES, point encodings and public key recovery.

Standards and references

All terms