webpg-npapi 0.6.1
|
Creates a threaded worker to run the gpg keygen operation.
Definition at line 1960 of file webpgPluginAPI.cpp. References get_gpgme_ctx(). Referenced by threaded_gpgGenKey(). { gpgme_ctx_t ctx = get_gpgme_ctx(); gpgme_error_t err; std::string params = "<GnupgKeyParms format=\"internal\">\n" "Key-Type: " + key_type + "\n" "Key-Length: " + key_length + "\n" "Subkey-Type: " + subkey_type + "\n" "Subkey-Length: " + subkey_length + "\n" "Name-Real: " + name_real + "\n"; if (name_comment.length() > 0) { params += "Name-Comment: " + name_comment + "\n"; } if (name_email.length() > 0) { params += "Name-Email: " + name_email + "\n"; } if (expire_date.length() > 0) { params += "Expire-Date: " + expire_date + "\n"; } else { params += "Expire-Date: 0\n"; } if (passphrase.length() > 0) { params += "Passphrase: " + passphrase + "\n"; } params += "</GnupgKeyParms>\n"; const char *parms = params.c_str(); gpgme_genkey_result_t result; gpgme_set_progress_cb (ctx, cb_status, APIObj); err = gpgme_op_genkey (ctx, parms, NULL, NULL); if (err) return "Error with genkey start" + err; result = gpgme_op_genkey_result (ctx); if (!result) { #ifdef DEBUG fprintf (stderr, "%s:%d: gpgme_op_genkey_result returns NULL\n", __FILE__, __LINE__); #endif return "error with result"; } #ifdef DEBUG printf ("Generated key: %s (%s)\n", result->fpr ? result->fpr : "none", result->primary ? (result->sub ? "primary, sub" : "primary") : (result->sub ? "sub" : "none")); #endif gpgme_release (ctx); const char* status = (char *) "complete"; cb_status(APIObj, status, 33, 33, 33); return "done"; }
Here is the call graph for this function:
|