# File lib/gpgme/signature.rb, line 28 def bad? status_code == GPGME::GPG_ERR_BAD_SIGNATURE end
# File lib/gpgme/signature.rb, line 64 def exp_timestamp Time.at(@exp_timestamp) end
# File lib/gpgme/signature.rb, line 20 def expired_key? status_code == GPGME::GPG_ERR_KEY_EXPIRED end
# File lib/gpgme/signature.rb, line 16 def expired_signature? status_code == GPGME::GPG_ERR_SIG_EXPIRED end
# File lib/gpgme/signature.rb, line 40 def from @from ||= begin Ctx.new do |ctx| if from_key = ctx.get_key(fingerprint) "#{from_key.subkeys[0].keyid} #{from_key.uids[0].uid}" else fingerprint end end end end
# File lib/gpgme/signature.rb, line 52 def key @key ||= begin Ctx.new do |ctx| @key = ctx.get_key(fingerprint) end end end
# File lib/gpgme/signature.rb, line 32 def no_key? status_code == GPGME::GPG_ERR_NO_PUBKEY end
# File lib/gpgme/signature.rb, line 24 def revoked_key? status_code == GPGME::GPG_ERR_CERT_REVOKED end
# File lib/gpgme/signature.rb, line 36 def status_code GPGME::gpgme_err_code(status) end
# File lib/gpgme/signature.rb, line 60 def timestamp Time.at(@timestamp) end
# File lib/gpgme/signature.rb, line 68 def to_s case status_code when GPGME::GPG_ERR_NO_ERROR "Good signature from #{from}" when GPGME::GPG_ERR_SIG_EXPIRED "Expired signature from #{from}" when GPGME::GPG_ERR_KEY_EXPIRED "Signature made from expired key #{from}" when GPGME::GPG_ERR_CERT_REVOKED "Signature made from revoked key #{from}" when GPGME::GPG_ERR_BAD_SIGNATURE "Bad signature from #{from}" when GPGME::GPG_ERR_NO_PUBKEY "No public key for #{from}" end end
Returns true if the signature is correct
# File lib/gpgme/signature.rb, line 12 def valid? status_code == GPGME::GPG_ERR_NO_ERROR end