class Siren::CLI::CryptoCommand

Public Instance Methods

execute() click to toggle source
# File lib/siren/cli.rb, line 40
def execute
  if File.exists?(privkey) && !force?
    STDERR.puts "Won't overwrite #{privkey}. Delete it first if you want to generate a new key."
    exit 1
  end
  private, public = Siren::Crypto.genkeys
  public.to_file(privkey)
  private.to_file(pubkey)
  puts "Keys generated. Keep #{privkey} secret. Give #{pubkey} to whoever needs it."
  puts "Thumbprint: #{JOSE::JWK.thumbprint(private)}"
end