Module: Gitlab::Gpg::CurrentKeyChain

Extended by:
CurrentKeyChain
Included in:
CurrentKeyChain
Defined in:
lib/gitlab/gpg.rb

Instance Method Summary collapse

Instance Method Details

#add(key) ⇒ Object



16
17
18
# File 'lib/gitlab/gpg.rb', line 16

def add(key)
  GPGME::Key.import(key)
end

#fingerprints_from_key(key) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/gitlab/gpg.rb', line 20

def fingerprints_from_key(key)
  import = GPGME::Key.import(key)

  return [] if import.imported == 0

  import.imports.map(&:fingerprint)
end