method

build_key

build_key()
public

No documentation available.

# File lib/rubygems/commands/cert_command.rb, line 131
  def build_key # :nodoc:
    if options[:key] then
      options[:key]
    else
      passphrase = ask_for_password 'Passphrase for your Private Key:'
      say "\n"

      passphrase_confirmation = ask_for_password 'Please repeat the passphrase for your Private Key:'
      say "\n"

      raise Gem::CommandLineError,
            "Passphrase and passphrase confirmation don't match" unless passphrase == passphrase_confirmation

      key      = Gem::Security.create_key
      key_path = Gem::Security.write key, "gem-private_key.pem", 0600, passphrase

      return key, key_path
    end
  end