aboutsummaryrefslogtreecommitdiff
path: root/lib/keyring/crypt.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/keyring/crypt.rb')
-rw-r--r--lib/keyring/crypt.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/keyring/crypt.rb b/lib/keyring/crypt.rb
index 8f0ac5d..4c9baaf 100644
--- a/lib/keyring/crypt.rb
+++ b/lib/keyring/crypt.rb
@@ -20,11 +20,20 @@
module Keyring
class Crypt
+ def initialize
+ @keyStore = UserConfig.instance.path + '/keys'
+ end
+
def decrypt(filename)
file = Backend::Fs.new()
content = file.get_as_string(filename)
crypt = Backend::Crypt.new(nil)
return crypt.decrypt(content)
end
+
+ def decryptKey(name)
+ filename = @keyStore + '/' + name + '.asc'
+ decrypt(filename)
+ end
end
end