I have code that sets uid after I start it as root. I have a user A
that owns a key, and I su - to root. Then I do:
./simple-signer <my key name> '<data to sign>' A
In this case, gpgme does not find the key for user A.
However, if I run the following as user A:
./simple-signer <my key name> '<data to sign>'
gpgme finds the key for user A.
I am attaching my code, for reference. My question is : do I need to
do something that will enable gpgme to find the key when I run my code
as root?