|
webpg-npapi 0.6.1
|
Sets the key specified with keyid as enabled in gpupg.
Definition at line 1765 of file webpgPluginAPI.cpp. References get_gpgme_ctx(). Referenced by webpgPluginAPI(). {
gpgme_ctx_t ctx = get_gpgme_ctx();
gpgme_error_t err;
gpgme_data_t out = NULL;
gpgme_key_t key = NULL;
FB::VariantMap response;
err = gpgme_op_keylist_start (ctx, keyid.c_str(), 0);
if (err != GPG_ERR_NO_ERROR)
return get_error_map(__func__, gpgme_err_code (err), gpgme_strerror (err), __LINE__, __FILE__);
err = gpgme_op_keylist_next (ctx, &key);
if (err != GPG_ERR_NO_ERROR)
return get_error_map(__func__, gpgme_err_code (err), gpgme_strerror (err), __LINE__, __FILE__);
err = gpgme_op_keylist_end (ctx);
if (err != GPG_ERR_NO_ERROR)
return get_error_map(__func__, gpgme_err_code (err), gpgme_strerror (err), __LINE__, __FILE__);
err = gpgme_data_new (&out);
if (err != GPG_ERR_NO_ERROR)
return get_error_map(__func__, gpgme_err_code (err), gpgme_strerror (err), __LINE__, __FILE__);
edit_status = "gpgEnableKey(keyid='" + keyid + "');\n";
err = gpgme_op_edit (ctx, key, edit_fnc_enable, out, out);
if (err != GPG_ERR_NO_ERROR)
return get_error_map(__func__, gpgme_err_code (err), gpgme_strerror (err), __LINE__, __FILE__);
gpgme_data_release (out);
gpgme_key_unref (key);
gpgme_release (ctx);
response["error"] = false;
response["result"] = "key enabled";
return response;
}
Here is the call graph for this function:
![]() |
1.7.4