webpg-npapi 0.6.1
FB::variant webpgPluginAPI::getPublicKeyList ( )

Calls webpgPluginAPI::getKeyList() without specifying a search string, and the secret_only paramter as "0", which returns only Public Keys from the keyring.

Definition at line 802 of file webpgPluginAPI.cpp.

References getKeyList().

Referenced by webpgPluginAPI().

{
    // Retrieve the public keylist
    FB::variant public_keylist = webpgPluginAPI::getKeyList("", 0);

    // Retrieve a reference to the DOM Window
    FB::DOM::WindowPtr window = m_host->getDOMWindow();

    // Check if the DOM Window has an in-built JSON Parser
    if (window && window->getJSObject()->HasProperty("JSON")) {
        // Convert the VariantMap to a Json::Value object
        Json::Value json_value = FB::variantToJsonValue(public_keylist);

        // Create a writer that will convert the object to a string
        Json::FastWriter writer;

        // Create a reference to the browswer JSON object
        FB::JSObjectPtr obj = window->getProperty<FB::JSObjectPtr>("JSON");

        return obj->Invoke("parse", FB::variant_list_of(writer.write(json_value)));
    } else {
        // No browser JSON parser detected, falling back to return of FB::variant
        return public_keylist;
    }
}

Here is the call graph for this function:

 All Classes Functions