Created
October 12, 2016 14:34
-
-
Save burke/324b8da8c23ee64522cda4b3a802a392 to your computer and use it in GitHub Desktop.
Create an Elliptic Curve keypair in ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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