Module: Mail::Gpg::VerifyResultAttribute

Included in:
GPGME::Data, VerifiedPart
Defined in:
lib/mail/gpg/verify_result_attribute.rb

Instance Method Summary collapse

Instance Method Details

#signature_valid?Boolean

checks validity of signatures (true / false)

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/mail/gpg/verify_result_attribute.rb', line 18

def signature_valid?
  sigs = self.signatures
  sigs.any? && sigs.detect{|s|!s.valid?}.blank?
end

#signaturesObject

list of all signatures from verify_result



24
25
26
27
28
# File 'lib/mail/gpg/verify_result_attribute.rb', line 24

def signatures
  [verify_result].flatten.compact.map do |vr|
    vr.signatures
  end.flatten.compact
end

#verify_result(result = nil) ⇒ Object

the result of signature verification, as provided by GPGME



6
7
8
9
10
11
12
# File 'lib/mail/gpg/verify_result_attribute.rb', line 6

def verify_result(result = nil)
  if result
    self.verify_result = result
  else
    @verify_result
  end
end

#verify_result=(result) ⇒ Object



13
14
15
# File 'lib/mail/gpg/verify_result_attribute.rb', line 13

def verify_result=(result)
  @verify_result = result
end