method
build_key
ruby latest stable - Class:
Gem::Commands::CertCommand
build_key()public
No documentation available.
# File lib/rubygems/commands/cert_command.rb, line 149
def build_key # :nodoc:
return options[:key] if options[:key]
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