Skip to content

Instantly share code, notes, and snippets.

@sprohaszka
Created March 31, 2023 14:09
Show Gist options
  • Save sprohaszka/09ea7d1ad7336aa04182d6fbf4e86c0a to your computer and use it in GitHub Desktop.
Save sprohaszka/09ea7d1ad7336aa04182d6fbf4e86c0a to your computer and use it in GitHub Desktop.
Generate private/public key with elliptic curve

Generate private and public key

Private key:

  openssl ecparam -name secp256k1 -genkey -noout -out sample-priv-key.pem

Public key (from private key):

  openssl ec -in sample-priv-key.pem -pubout > sample-pub-key.pem

Read file info

  openssl ec -text -in sample-priv-key.pem

(ecparam is for Eliptic Curves params)

References

Akamai

secp256k1 vs secp256r1

OID secp256r1

OID secp256k1

sec1

sec2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment