Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-02-22 20:36:25 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:40:41 +0300
commit87c0fd34557463528a552986a42f4ebb52d3bd56 (patch)
tree18b35c83421e8a96d4ec49bc248750d9d536b58c /lib/gitlab/gpg.rb
parente34cef0cd2fcf9a01d3f3b6dd215bbcc25d65d27 (diff)
add / remove gpg keys to / from system keychain
Diffstat (limited to 'lib/gitlab/gpg.rb')
-rw-r--r--lib/gitlab/gpg.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/gpg.rb b/lib/gitlab/gpg.rb
index 373ef79ab85..64f18d00e46 100644
--- a/lib/gitlab/gpg.rb
+++ b/lib/gitlab/gpg.rb
@@ -12,6 +12,14 @@ module Gitlab
end
end
+ def add_to_keychain(key)
+ GPGME::Key.import(key)
+ end
+
+ def remove_from_keychain(fingerprint)
+ GPGME::Key.get(fingerprint).delete!
+ end
+
def using_tmp_keychain
Dir.mktmpdir do |dir|
@original_dirs ||= [GPGME::Engine.dirinfo('homedir')]