I want to configure gpg-agent to cache a specific key for a set duration longer than other keys in my keyring.
Is there a way to configure gpg-agent to set key caching duration for specific keys?
I want to configure gpg-agent to cache a specific key for a set duration longer than other keys in my keyring.
Is there a way to configure gpg-agent to set key caching duration for specific keys?
gpg-agent does not support varying cache durations for different keys.
A workaround I can imagine (but only for very specific kinds of tasks, like one set of keys for normal operation, and a special key for a completely different task like signing git commits) would be to move the "special" keys to their own GnuPG home directory, and starting an individual gpg-agent with the desired cache time and a distinct socket for this key.
This will not work out well for "general" keys you want to use in different applications and especially not if you want to use keys from multiple gpg-agents in a single client application like Thunderbird with Enigmail, as they are not prepared for such a hack. Expect some trouble when setting up such a configuration until you managed to properly set up gpg-agent's socket, environment variable and GnuPG home directory environment variable.