Method: Acme::Client#initialize
- Defined in:
- lib/acme/client.rb
#initialize(jwk: nil, kid: nil, private_key: nil, directory: DEFAULT_DIRECTORY, connection_options: {}, bad_nonce_retry: 0) ⇒ Client
Returns a new instance of Client.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/acme/client.rb', line 34 def initialize(jwk: nil, kid: nil, private_key: nil, directory: DEFAULT_DIRECTORY, connection_options: {}, bad_nonce_retry: 0) if jwk.nil? && private_key.nil? raise ArgumentError, 'must specify jwk or private_key' end @jwk = if jwk jwk else Acme::Client::JWK.from_private_key(private_key) end @kid, @connection_options = kid, @bad_nonce_retry = bad_nonce_retry @directory_url = URI(directory) @nonces ||= [] end |