Key generation with GPGME and GnuPG hangs at gpgme_op_genkey

Robert J. Hansen rjh at
Tue Jan 26 11:43:46 CET 2016

> This is my first message to an e-mail list ever. I don't even know if
> this is the right e-mail list for me, please forgive me if I'm wrong,
> but unfortunately I didn't found a GPGME e-mail list.

Welcome!  You're in the right place, and we'll be happy to help you out.
 You may wish to switch from HTML email to plain-text; that's the
standard for this list.

> There is no error while initialising the library, so I don't know why it
> stops at gpgme_op_genkey. Maybe GnuPG is trying to collect entropie? If
> I generate a key using the GnuPG command line it tooks a very long time
> to collect entropie. But after ~15 minutes the key generation completes
> successfully (I didn't noticed that my program finished so far, even
> after 15 minutes+).

If it's taking your GnuPG setup ~15 minutes to generate a new
certificate, that indicates to me your GnuPG installation has a problem.
Let's tackle that one first before we start looking at your code.

Are you getting periodic messages about "Not enough random bytes
available.  Please do some other work to give the OS a chance to
collect more entropy! (Need 167 more bytes)" or something like that?

More information about the Gnupg-users mailing list