1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
module Mail
module Gpg
module VerifyResultAttribute
# the result of signature verification, as provided by GPGME
def verify_result(result = nil)
if result
self.verify_result = result
else
@verify_result
end
end
def verify_result=(result)
@verify_result = result
end
# checks validity of signatures (true / false)
def signature_valid?
sigs = self.signatures
sigs.any? && sigs.all?{|s|s.valid?}
end
# list of all signatures from verify_result
def signatures
[verify_result].flatten.compact.map do |vr|
vr.signatures
end.flatten.compact
end
end
end
end
|