webpg-npapi 0.6.1
std::string webpgPluginAPI::get_preference ( const std::string &  preference)

Attempts to retrieve the specified preference from the gpgconf utility.

Parameters:
preferenceThe gpgconf preference to retrieve.

Definition at line 926 of file webpgPluginAPI.cpp.

References get_gpgme_ctx().

Referenced by gpgSignUID().

{
    gpgme_ctx_t ctx = get_gpgme_ctx();
    gpgme_error_t err;
    gpgme_conf_comp_t conf, comp;
    gpgme_conf_opt_t opt;
    std::string return_value;

    err = gpgme_op_conf_load (ctx, &conf);

    comp = conf;
    while (comp && strcmp (comp->name, "gpg"))
        comp = comp->next;

    if (comp) {
        opt = comp->options;
        while (opt && strcmp (opt->name, (char *) preference.c_str())){
            opt = opt->next;
        }

        if (opt->value) {
            return_value = opt->value->value.string;
        } else {
            return_value = "blank";
        }
    }

    gpgme_conf_release (conf);

    return return_value;

}

Here is the call graph for this function:

 All Classes Functions