method

load_default_key

load_default_key()
public

No documentation available.

# File lib/rubygems/commands/cert_command.rb, line 257
  def load_default_key
    key_file = File.join Gem.default_key_path
    key = File.read key_file
    passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE']
    options[:key] = OpenSSL::PKey::RSA.new key, passphrase
  rescue Errno::ENOENT
    alert_error        "--private-key not specified and ~/.gem/gem-private_key.pem does not exist"

    terminate_interaction 1
  rescue OpenSSL::PKey::RSAError
    alert_error        "--private-key not specified and ~/.gem/gem-private_key.pem is not valid"

    terminate_interaction 1
  end