method

load_default_key

Importance_0
v2_1_10 - Show latest stable - 0 notes - Class: CertCommand
load_default_key() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/commands/cert_command.rb, line 226
  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
Register or log in to add new notes.