ueno/ruby-gpgme

how do you "gpg --list-sigs"?

Closed this issue · 7 comments

Use an empty pattern to return all keys.

ueno commented

See https://www.gnupg.org/documentation/manuals/gnupg/Specify-a-User-ID.html#Specify-a-User-ID

Here is an example of listing signatures associated with a key:

require 'gpgme'

ctx = GPGME::Ctx.new(:keylist_mode => GPGME::KEYLIST_MODE_SIGS)
ctx.each_key('pattern') do |key|
  p key.uids.map {|uid| [uid.name, uid.signatures.map {|sig| sig.keyid}] }
end

ok, thank you very much, I hava fixed, as you had writed@ueno

sorry that ask a question that is not related to this lib, but is related to gpg
The fingerprint and keyId are unique in one database?

ueno commented

Basically so. See http://tools.ietf.org/html/rfc4880#section-12.2 for more detail about fingerprints and key IDs.

ok ,thanks @ueno , Timely help.

ueno commented

closing this for now. if you have further questions, maybe good to ask on the gnupg-users mailing list.