Exception: Akabei::Signer::AmbiguousKey

Inherits:
Error
  • Object
show all
Defined in:
lib/akabei/signer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_name, found_keys) ⇒ AmbiguousKey

Returns a new instance of AmbiguousKey.



16
17
18
19
20
# File 'lib/akabei/signer.rb', line 16

def initialize(key_name, found_keys)
  @key_name = key_name
  @found_keys = found_keys
  super("Ambiguous GPG key: #{key_name}: #{formatted_keys}")
end

Instance Attribute Details

#found_keysObject (readonly)

Returns the value of attribute found_keys.



15
16
17
# File 'lib/akabei/signer.rb', line 15

def found_keys
  @found_keys
end

#key_nameObject (readonly)

Returns the value of attribute key_name.



15
16
17
# File 'lib/akabei/signer.rb', line 15

def key_name
  @key_name
end

Instance Method Details

#formatted_keysObject



22
23
24
25
26
27
# File 'lib/akabei/signer.rb', line 22

def formatted_keys
  @found_keys.map do |key|
    subkey = key.primary_subkey
    "#{subkey.length}#{subkey.pubkey_algo_letter}/#{subkey.fingerprint[-8 .. -1]}"
  end
end