Sha256: 3b127358979c13511d838596a1973aff601866789b9e4aa7bf4b351d05c703ea

Contents?: true

Size: 371 Bytes

Versions: 16

Compression:

Stored size: 371 Bytes

Contents

require 'openssl'

module SoarAuthenticationToken
  class KeypairGenerator
    def initialize
    end

    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

    private

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
soar_authentication_token-3.0.5 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-3.0.4 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-3.0.3 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-3.0.2 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-3.0.1 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-3.0.0 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-2.0.3 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-2.0.2 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-2.0.1 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-2.0.0 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-1.0.0 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-0.1.0 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-0.0.4 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-0.0.3 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-0.0.2 lib/soar_authentication_token/keypair_generator.rb
soar_authentication_token-0.0.1 lib/soar_authentication_token/keypair_generator.rb