diff options
Diffstat (limited to 'lib/gitlab/gpg.rb')
-rw-r--r-- | lib/gitlab/gpg.rb | 8 |
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')] |