webpg-npapi 0.6.1
Public Member Functions | Static Public Member Functions
webpgPluginAPI Class Reference

Main webpg Class. More...

#include "webpgPluginAPI.h"

List of all members.

Public Member Functions

 webpgPluginAPI (const webpgPluginPtr &plugin, const FB::BrowserHostPtr &host)
 Constructor for the JSAPI object. Registers methods, properties, and events that should be accessible to Javascript.
virtual ~webpgPluginAPI ()
 Destructor. Remember that this object will not be released until the browser is done with it; this will almost definitely be after the plugin is released.
webpgPluginPtr getPlugin ()
 Gets a reference to the plugin that was passed in when the object was created. If the plugin has already been released then this will throw a FB::script_error that will be translated into a javascript exception in the page.
FB::VariantMap get_webpg_status ()
 Executes webpgPluginAPI::init() to set the status variables and populates the "edit_status" property with the contents of the edit_status constant.
void init ()
 Initializes the webpgPlugin and sets the status variables.
gpgme_ctx_t get_gpgme_ctx ()
 Creates the gpgme context with the required options.
FB::VariantMap getKeyList (const std::string &name, int secret_only)
 Retrieves all keys matching name, or if name is not specified, returns all keys in the keyring. The keyring to use is determined by the integer value of secret_only.
FB::variant getNamedKey (const std::string &name)
 Calls webpgPluginAPI::getKeyList() with a search string and the secret_only paramter as "0", which returns only Public Keys from the keyring.
FB::variant getPublicKeyList ()
 Calls webpgPluginAPI::getKeyList() without specifying a search string, and the secret_only paramter as "0", which returns only Public Keys from the keyring.
FB::variant getPrivateKeyList ()
 Calls webpgPluginAPI::getKeyList() without specifying a search string, and the secret_only paramter as "1", which returns only Private Keys from the keyring.
std::string get_preference (const std::string &preference)
 Attempts to retrieve the specified preference from the gpgconf utility.
FB::variant gpgSetPreference (const std::string &preference, const std::string &pref_value="")
 Attempts to set the specified gpgconf preference with the value of pref_value.
FB::variant gpgGetPreference (const std::string &preference)
 Attempts to retrieve the specified preference from the gpgconf utility.
std::string getGPGConfigFilename ()
 Attempts to determine the correct location of the gpg configuration file.
FB::variant setTempGPGOption (const std::string &option, const std::string &value=NULL)
 Creates a backup of the gpg.conf file and writes the options to gpg.conf; This should be called prior to initializing the context.
FB::variant restoreGPGConfig ()
 Restores the gpg.conf file from memory or the backup file.
FB::variant gpgSetHomeDir (const std::string &data)
 Sets the GNUPGHOME static variable to the path specified in gnupg_path. This should be called prior to initializing the gpgme context.
FB::variant getTemporaryPath ()
 Attempts to determine the system or user temporary path.
FB::variant gpgEncrypt (const std::string &data, const FB::VariantList &enc_to_keyids, bool sign=false)
 Encrypts the data passed in data with the key ids passed in enc_to_keyids and optionally signs the data.
FB::variant gpgSymmetricEncrypt (const std::string &data, bool sign=false)
 Calls webpgPluginAPI::gpgEncrypt() without any recipients specified which initiates a Symmetric encryption method on the gpgme context.
FB::variant gpgDecryptVerify (const std::string &data, int use_agent)
 Attempts to decrypt and verify the string data. If use_agent is 0, it will attempt to disable the key-agent to prevent the passphrase dialog from displaying. This is useful in cases where you want to verify or decrypt without unlocking the private keyring (i.e. in an automated parsing environment).
FB::variant gpgDecrypt (const std::string &data)
 Calls webpgPluginAPI::gpgDecryptVerify() with the use_agent flag specifying to not disable the gpg-agent.
FB::variant gpgSignText (const FB::VariantList &signers, const std::string &plain_text, int sign_mode)
 Signs the text specified in plain_text with the key ids specified in signers, with the signature mode specified in sign_mode.
FB::variant gpgSignUID (const std::string &keyid, long uid, const std::string &with_keyid, long local_only=NULL, long trust_sign=NULL, long trust_level=NULL)
 Signs the UID index of the specified keyid using the signing key with_keyid.
FB::variant gpgDeleteUIDSign (const std::string &keyid, long sign_uid, long signature)
 Deletes the Signature signature on the uid of keyid.
FB::variant gpgEnableKey (const std::string &keyid)
 Sets the key specified with keyid as enabled in gpupg.
FB::variant gpgDisableKey (const std::string &keyid)
 Sets the key specified with keyid as disabled in gpupg.
std::string gpgGenKey (const std::string &key_type, const std::string &key_length, const std::string &subkey_type, const std::string &subkey_length, const std::string &name_real, const std::string &name_comment, const std::string &name_email, const std::string &expire_date, const std::string &passphrase)
 Queues a threaded gpg genkey operation.
void threaded_gpgGenKey (genKeyParams params)
 Calls webpgPluginAPI::gpgGenKeyWorker() with the specified parameters.
void threaded_gpgGenSubKey (genSubKeyParams params)
 Calls webpgPluginAPI::gpgGenSubKeyWorker() with the specified parameters.
FB::variant gpgImportKey (const std::string &ascii_key)
 Imports the ASCII encoded key ascii_key.
FB::variant gpgDeleteKey (const std::string &keyid, int allow_secret)
 Deletes the key specified in keyid from the keyring.
FB::variant gpgDeletePublicKey (const std::string &keyid)
 Deletes key specified in keyid from the Public keyring.
FB::variant gpgDeletePrivateKey (const std::string &keyid)
 Deletes key specified in keyid from the Private keyring.
FB::variant gpgDeletePrivateSubKey (const std::string &keyid, int key_idx)
 Deletes subkey located at index key_idx form the key specified in keyid.
FB::variant gpgGenSubKey (const std::string &keyid, const std::string &subkey_type, const std::string &subkey_length, const std::string &subkey_expire, bool sign_flag, bool enc_flag, bool auth_flag)
 Queues a threaded gpg gensubkey operation.
FB::variant gpgSetKeyTrust (const std::string &keyid, long trust_level)
 Sets the gnupg trust level assignment for the given keyid.
FB::variant gpgAddUID (const std::string &keyid, const std::string &name, const std::string &email, const std::string &comment)
 Adds a new UID to the key specified by keyid.
FB::variant gpgDeleteUID (const std::string &keyid, long uid_idx)
 Deletes the UID specified by uid_idx from the key specified with keyid.
FB::variant gpgSetPrimaryUID (const std::string &keyid, long uid_idx)
 Sets a given UID as the primary for the key specified with keyid.
FB::variant gpgSetKeyExpire (const std::string &keyid, long key_idx, long expire)
 Sets the expiration of the given key_idx on the key keyid with the expiration of expire.
FB::variant gpgSetPubkeyExpire (const std::string &keyid, long expire)
 Sets the expiration of the public key of the given keyid.
FB::variant gpgSetSubkeyExpire (const std::string &keyid, long key_idx, long expire)
 Sets the expiration of the subkey specified with key_idx on the key specified with keyid.
FB::variant gpgExportPublicKey (const std::string &keyid)
 Exports the public key specified with keyid as an armored ASCII encoded PGP Block.
FB::variant gpgRevokeItem (const std::string &keyid, const std::string &item, int key_idx, int uid_idx, int sig_idx, int reason_idx, const std::string &desc)
 Revokes a give key, trust item, subkey, uid or signature with the specified reason and description.
FB::variant gpgRevokeKey (const std::string &keyid, int key_idx, int reason, const std::string &desc)
 Revokes the given key/subkey with the reason and description specified.
FB::variant gpgRevokeUID (const std::string &keyid, int uid_idx, int reason, const std::string &desc)
 Revokes the given UID with the reason and description specified.
FB::variant gpgRevokeSignature (const std::string &keyid, int uid_idx, int sig_idx, int reason, const std::string &desc)
 Revokes the given signature on the specified UID of key keyid with the reason and description specified.
FB::variant gpgChangePassphrase (const std::string &keyid)
 Invokes the gpg-agent to change the passphrase for the given key.
std::string get_version ()
 Retruns the defined plugin version.
bool gpgconf_detected ()
 Determines if the gpgconf util is available to the gpgme_engine.
std::string gpgGenKeyWorker (const std::string &key_type, const std::string &key_length, const std::string &subkey_type, const std::string &subkey_length, const std::string &name_real, const std::string &name_comment, const std::string &name_email, const std::string &expire_date, const std::string &passphrase, void *APIObj, void(*cb_status)(void *self, const char *what, int type, int current, int total))
 Creates a threaded worker to run the gpg keygen operation.
FB::variant gpgGenSubKeyWorker (const std::string &keyid, const std::string &subkey_type, const std::string &subkey_length, const std::string &subkey_expire, bool sign_flag, bool enc_flag, bool auth_flag, void *APIObj, void(*cb_status)(void *self, const char *what, int type, int current, int total))
 Creates a threaded worker to run the gpg keygen operation.

Static Public Member Functions

static void progress_cb (void *self, const char *what, int type, int current, int total)
 Called by the long-running, asymmetric gpg genkey method to display the status.

Detailed Description

Main webpg Class.

Definition at line 108 of file webpgPluginAPI.h.


The documentation for this class was generated from the following files:
 All Classes Functions