mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 05:47:53 +00:00
23 lines
565 B
Ruby
23 lines
565 B
Ruby
#!/usr/bin/ruby
|
|
|
|
require 'fileutils'
|
|
require 'gpgme'
|
|
|
|
FileUtils.rm_rf("#{Dir.home}/.config/mpw")
|
|
FileUtils.rm_rf("#{Dir.home}/.gnupg")
|
|
|
|
param = ''
|
|
param << '<GnupgKeyParms format="internal">' + "\n"
|
|
param << "Key-Type: RSA\n"
|
|
param << "Key-Length: 512\n"
|
|
param << "Subkey-Type: ELG-E\n"
|
|
param << "Subkey-Length: 512\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)
|