1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-12-05 02:23:04 +00:00
mpw/test/init.rb

20 lines
465 B
Ruby
Raw Normal View History

2017-02-11 12:43:29 +00:00
#!/usr/bin/ruby
require 'gpgme'
param = ''
param << '<GnupgKeyParms format="internal">' + "\n"
param << "Key-Type: RSA\n"
param << "Key-Length: 2048\n"
param << "Subkey-Type: ELG-E\n"
param << "Subkey-Length: 2048\n"
param << "Name-Real: test\n"
param << "Name-Comment: test\n"
param << "Name-Email: test2@example.com\n"
param << "Expire-Date: 0\n"
param << "Passphrase: password\n"
param << "</GnupgKeyParms>\n"
ctx = GPGME::Ctx.new
ctx.genkey(param, nil, nil)