Class: SoarAuthenticationToken::KeypairGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/soar_authentication_token/keypair_generator.rb

Instance Method Summary collapse

Instance Method Details

#generateObject



5
6
7
8
9
10
11
# File 'lib/soar_authentication_token/keypair_generator.rb', line 5

def generate
  private_key = OpenSSL::PKey::EC.new 'secp521r1'
  private_key.generate_key
  public_key = OpenSSL::PKey::EC.new private_key
  public_key.private_key = nil
  [private_key.to_pem, public_key.to_pem]
end