new_api.js

Summary
new_api.js
Constants
FireGPG’s API constants
Functions
FireGPG.sign(text, pub_key_id)Sign a text and return an object containing two attributes :
FireGPG.encrypt(text, priv_key_id)Encrypt a text and return the result in an object.

Constants

FireGPG’s API constants

FireGPG.ERROR_NOTHINGno error
FireGPG.ERROR_UNSELECTED_GPG_IDif the Key ID was not selected when the window was opened
FireGPG.ERROR_BAD_GPG_IDif the Key ID is bad or it does not exist
FireGPG.ERROR_PASS_NOT_ENTEREDif no password is entered
FireGPG.ERROR_BAD_PASSthe password is incorrect
FireGPG.ERROR_UNKNOWNunknown error

Functions

FireGPG.sign(text, pub_key_id)

Sign a text and return an object containing two attributes :

  • result: the text signed
  • error: a constant FireGPG.ERROR_*

NB: pub_key_id is optional.

FireGPG.encrypt(text, priv_key_id)

Encrypt a text and return the result in an object.

Parameters

textthe text, encrypt
priv_key_idthe GPG id of the private key (optional)

Returns

An object containing two attributes:

resultthe encrypted text
errora constant containing a constant FireGPG.ERROR_*
Close