gpgme can't find keys

William Yu william.yu at
Fri Mar 4 16:33:57 CET 2022


I am running Ubuntu 20.04.4 LTS, I installed libgpgme11 from Ubuntu with version 1.13.1-7ubuntu2 and I installed gpg2 with gpg 2.2.19, libgcrypt 1.8.5.

My problem is this, I try to use keys on my computer in a C program and sign something with it. Currently my program can't find any keys. I can see 2 of my keys in terminal with gpg2 --list-keys. One key is 1024 bits, no passphrase, type 4(RSA) key, the other is the same but type 1 + subkey. I attached my test c program, which basically just configured everything according to manual and try to read out the keys. I also tried to generate key with my test program but it returned GPG_ERR_NOT_SUPPORTED.

I setup everything as default, so my home folder is /home/wyu/.gnupg, gpg2 locates in /usr/bin/gpg2 and so on. Maybe someone could tell me what have I missed?

Thanks a lot and best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tstgpgme.c
Type: text/x-csrc
Size: 3999 bytes
Desc: not available
URL: <>

More information about the Gnupg-users mailing list