How to list trust level of OpenPGP public keys in GnuPG

gnupgopenpgppublic-keytrust

While I can determine the trust level I have placed on an individual OpenPGP public key by using the --edit-key command, is there a simple way to list all the public keys along with their trust levels from the command line?

Best Answer

You can export all configured owner trust through gpg --export-ownertrust. The output is of the form

FINGERPRINT:TRUST:

For my own key (which has ultimate trust on my machine), there is following line included:

0D69E11F12BDBA077B3726AB4E1F799AA4FF2279:6:

It seems the trust level is corresponds to the number entered in the trust edit command plus one:

1 = I don't know or won't say (export: 2)
2 = I do NOT trust            (export: 3)
3 = I trust marginally        (export: 4)
4 = I trust fully             (export: 5)
5 = I trust ultimately        (export: 6)

The output of this command can also be imported again through gpg --import-ownertrust.

Related Question