lib/io_streams/pgp.rb in iostreams-1.1.1 vs lib/io_streams/pgp.rb in iostreams-1.2.0
- old
+ new
@@ -178,11 +178,11 @@
!list_keys(email: email, key_id: key_id, private: private).empty?
end
# Deprecated
def self.has_key?(**args)
- key(**args)
+ key?(**args)
end
# Returns [Array<Hash>] the list of keys.
# Each Hash consists of:
# key_length: [Integer]
@@ -325,10 +325,10 @@
# Notes:
# - If the same email address has multiple keys then only the first is currently trusted.
def self.import_and_trust(key:)
raise(ArgumentError, "Key cannot be empty") if key.nil? || (key == "")
- email = key_info(key: key).first.fetch(:email)
+ email = key_info(key: key).last.fetch(:email)
raise(ArgumentError, "Recipient email cannot be extracted from supplied key") unless email
import(key: key)
set_trust(email: email)
email