Sha256: 08913d83c3c2d8e8ea6480c2cec3ab8ebbc78bb30b8e81d810e1b9531fa6bda3

Contents?: true

Size: 573 Bytes

Versions: 18

Compression:

Stored size: 573 Bytes

Contents

module Acme::Client::JWK
  # Make a JWK from a private key.
  #
  # private_key - An OpenSSL::PKey::EC or OpenSSL::PKey::RSA instance.
  #
  # Returns a JWK::Base subclass instance.
  def self.from_private_key(private_key)
    case private_key
    when OpenSSL::PKey::RSA
      Acme::Client::JWK::RSA.new(private_key)
    when OpenSSL::PKey::EC
      Acme::Client::JWK::ECDSA.new(private_key)
    else
      raise ArgumentError, 'private_key must be EC or RSA'
    end
  end
end

require 'acme/client/jwk/base'
require 'acme/client/jwk/rsa'
require 'acme/client/jwk/ecdsa'

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
acme-client-2.0.12 lib/acme/client/jwk.rb
acme-client-2.0.11 lib/acme/client/jwk.rb
acme-client-2.0.10 lib/acme/client/jwk.rb
acme-client-2.0.9 lib/acme/client/jwk.rb
acme-client-2.0.8 lib/acme/client/jwk.rb
acme-client-2.0.7 lib/acme/client/jwk.rb
acme-client-2.0.6 lib/acme/client/jwk.rb
acme-client-2.0.5 lib/acme/client/jwk.rb
acme-client-2.0.4 lib/acme/client/jwk.rb
acme-client-2.0.3 lib/acme/client/jwk.rb
acme-client-2.0.2 lib/acme/client/jwk.rb
acme-client-2.0.1 lib/acme/client/jwk.rb
acme-client-2.0.0 lib/acme/client/jwk.rb
acme-client-1.0.0 lib/acme/client/jwk.rb
acme-client-0.6.3 lib/acme/client/jwk.rb
acme-client-0.6.2 lib/acme/client/jwk.rb
acme-client-0.6.1 lib/acme/client/jwk.rb
acme-client-0.6.0 lib/acme/client/jwk.rb