Skip to content

Instantly share code, notes, and snippets.

@burke
Created October 12, 2016 14:34
Show Gist options
  • Save burke/324b8da8c23ee64522cda4b3a802a392 to your computer and use it in GitHub Desktop.
Save burke/324b8da8c23ee64522cda4b3a802a392 to your computer and use it in GitHub Desktop.
Create an Elliptic Curve keypair in ruby
require 'openssl'
k = OpenSSL::PKey::EC.new('secp384r1').generate_key
p = OpenSSL::PKey::EC.new(k.public_key.group)
p.public_key = k.public_key
puts k.to_pem, p.to_pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment