The newer version of GnuPG which is 2.1 has the function "gpgme_op_createkey" in the library GPGme. The older one this:
gpgme_op_genkey(mContext, def.c_str(), NULL, NULL);
Which accepts data in this format:
char *def = "<GnupgKeyParms format=\"internal\"> \n"
" Key-Type: default \n"
" Subkey-Type: default \n"
" Name-Real: Joe Tester3 \n"
" Name-Comment: with stupid passphrase \n"
" Name-Email: joe3@foo.bar \n"
" Expire-Date: 0 \n"
" Passphrase: abc \n"
" </GnupgKeyParms>";
However, the newer version of GnuPG accepts fewer arguments:
gpgme_op_createkey(gpgme_ctx_t ctx, const char *userid, const char *algo, unsigned long reserved, unsigned long expires,
gpgme_key_t certkey, unsigned int flags);
How can I provide to the newer function "gpgme_op_createkey", say, passphrase? subkey-type?
Also, if it's ECC, how can I choose which curve to use? For example "ed25519"?