2

In some GnuPG options (--cert-notation, --sig-notation, --photo-viewer and others) there can be used certain placeholders (for instance %k, %f etc.).

What is the purpose of using that placeholders? In which programs are they expanded?

1

Using those placeholders is especially helpful if you define such notations in your GnuPG configuration (~/.gnupg/gpg.conf). These placeholders get replaced by GnuPG just before the notation is applied (or the photo viewer called, ...) to be able to insert some information on the current operation. From man gpg:

There are special codes that may be used in notation names. "%k" will be expanded into the key ID of the key being signed, "%K" into the long key ID of the key being signed, "%f" into the fingerprint of the key being signed, "%s" into the key ID of the key making the signature, "%S" into the long key ID of the key making the signature, "%g" into the fingerprint of the key making the signature (which might be a subkey), "%p" into the fingerprint of the primary key of the key making the signature, "%c" into the signature count from the OpenPGP smartcard, and "%%" results in a single "%". %k, %K, and %f are only meaningful when making a key signature (certification), and %c is only meaningful when using the OpenPGP smartcard.

For example, consider you're running some certification service and host a website with further details on the certification of each key. If you want to append a notation containing a URL to further information on the signed key (without any discussion on how to achieve that), you could add following to your gpg.conf:

cert-notation details@cert.example.com=https://cert.example.com/lookup/%K

If you now sign a key 4E1F799AA4FF2279, following notation will be appended:

details@cert.example.com=https://cert.example.com/lookup/4E1F799AA4FF2279

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.