aboutsummaryrefslogtreecommitdiff
path: root/lib/keyring
diff options
context:
space:
mode:
Diffstat (limited to 'lib/keyring')
-rw-r--r--lib/keyring/crypt.rb10
-rw-r--r--lib/keyring/fs.rb13
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/keyring/crypt.rb b/lib/keyring/crypt.rb
new file mode 100644
index 0000000..5968730
--- /dev/null
+++ b/lib/keyring/crypt.rb
@@ -0,0 +1,10 @@
+module Keyring
+ class Crypt
+ def decrypt(filename)
+ file = Fs.new()
+ content = file.get_as_string(filename)
+ crypt = Backend::Crypt.new(nil)
+ return crypt.decrypt(content)
+ end
+ end
+end
diff --git a/lib/keyring/fs.rb b/lib/keyring/fs.rb
new file mode 100644
index 0000000..9f20378
--- /dev/null
+++ b/lib/keyring/fs.rb
@@ -0,0 +1,13 @@
+module Keyring
+ class Fs
+ def get_as_string(filename)
+ data = ''
+ f = File.open(filename, "r")
+ f.each_line do |line|
+ data += line
+ end
+ return data
+ end
+ end
+end
+