Flowdock
method

build_key

Importance_0
v2_1_10 - Show latest stable - 0 notes - Class: CertCommand
build_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 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
Register or log in to add new notes.