From c1cab93dce65fa3091bd2e786bab4c6b79b25a96 Mon Sep 17 00:00:00 2001 From: nishiki Date: Fri, 6 May 2016 10:53:32 +0200 Subject: [PATCH] write pub key in tarball --- lib/mpw/mpw.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/mpw/mpw.rb b/lib/mpw/mpw.rb index 654cd25..d022849 100644 --- a/lib/mpw/mpw.rb +++ b/lib/mpw/mpw.rb @@ -99,8 +99,6 @@ class MPW ) end - - Gem::Package::TarWriter.new(File.open(@wallet_file, 'w+')) do |tar| data_encrypt = encrypt(YAML::dump(data)) tar.add_file_simple('wallet/meta.gpg', 0400, data_encrypt.length) do |io| @@ -112,8 +110,13 @@ class MPW io.write(password) end end - end + @keys.each do |id, key| + tar.add_file_simple("wallet/keys/#{id}.pub", 0400, key.length) do |io| + io.write(password) + end + end + end end # TODO comment