Class: GPGME::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/gpgme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fprObject (readonly) Also known as: fingerprint

Returns the value of attribute fpr.



1399
1400
1401
# File 'lib/gpgme.rb', line 1399

def fpr
  @fpr
end

#notationsObject (readonly)

Returns the value of attribute notations.



1399
1400
1401
# File 'lib/gpgme.rb', line 1399

def notations
  @notations
end

#pka_addressObject (readonly)

Returns the value of attribute pka_address.



1401
1402
1403
# File 'lib/gpgme.rb', line 1401

def pka_address
  @pka_address
end

#pka_trustObject (readonly)

Returns the value of attribute pka_trust.



1401
1402
1403
# File 'lib/gpgme.rb', line 1401

def pka_trust
  @pka_trust
end

#statusObject (readonly)

Returns the value of attribute status.



1399
1400
1401
# File 'lib/gpgme.rb', line 1399

def status
  @status
end

#summaryObject (readonly)

Returns the value of attribute summary.



1399
1400
1401
# File 'lib/gpgme.rb', line 1399

def summary
  @summary
end

#validityObject (readonly)

Returns the value of attribute validity.



1400
1401
1402
# File 'lib/gpgme.rb', line 1400

def validity
  @validity
end

#validity_reasonObject (readonly)

Returns the value of attribute validity_reason.



1400
1401
1402
# File 'lib/gpgme.rb', line 1400

def validity_reason
  @validity_reason
end

#wrong_key_usageObject (readonly)

Returns the value of attribute wrong_key_usage.



1399
1400
1401
# File 'lib/gpgme.rb', line 1399

def wrong_key_usage
  @wrong_key_usage
end

Instance Method Details

#exp_timestampObject



1408
1409
1410
# File 'lib/gpgme.rb', line 1408

def exp_timestamp
  Time.at(@exp_timestamp)
end

#timestampObject



1404
1405
1406
# File 'lib/gpgme.rb', line 1404

def timestamp
  Time.at(@timestamp)
end

#to_sObject



1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
# File 'lib/gpgme.rb', line 1412

def to_s
  ctx = Ctx.new
  if from_key = ctx.get_key(fingerprint)
    from = "#{from_key.subkeys[0].keyid} #{from_key.uids[0].uid}"
  else
    from = fingerprint
  end
  case GPGME::gpgme_err_code(status)
  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_ERROR
  "No public key for #{from}"
  end
end