| cgpgaccess.js | |
| Constants | |
| nsIExtensionManager_CONRACTID | The component id to manage extentions |
| NS_APPINFO_CONTRACTID | The component id to test the current os |
| FireGPG. | The component to test the current os. |
| OS_WINDOWS | The value retruned by components if the os is window |
| idAppli | The id of firegpg. |
| States of the xpcom support. Deprecated | |
| comment | The firegpg’s comment to add to gnupg texts. |
| Variables | |
| useGPGTrust | If we have to disable trusting system of gnupg. |
| FireGPG. | The folder of Firefox |
| Functions | |
| loadXpcom | This function try to load the xpcom. |
| FireGPG. | Return true if we should use the agent (option and environement variable set |
| FireGPGGPGAccess | This is the main class to access to the gnupg executable. |
| Variables | |
| FireGPGCall | The FireGPGCall xpcom. |
| Functions | |
| isUnix | Return true if we are on a unix system, false if we’re on windows. |
| getGPGBonusCommand | Return the custom arguement the user want to add. |
| getGPGCommentArgument | Return a arguement to add a gnupg comment. |
| getGPGCommentArgument | Return a arguement to disable or not the gnupg agent, as set in the options. |
| getGPGTrustArgument | Return a arguement to force gnupg to use not trusted keys. |
| getGPGCommand | Return the command to execute GnuPG |
| getBaseArugments | |
| getProxyInformation | Return the option to set the proxy for keyservers |
| getDiegestAlgo | Return the option to set diegest algo to use for signs hashs |
| getEnv | Return environement parameters |
| runGnupg | Execute gnupg. |
| sign | Sign a text. |
| verify | Verify a text. |
| listkey | List keys. |
| listSigns | List signs. |
| crypt | Encrypt a text. |
| symetric | Symetricaly encrypt a text. |
| cryptAndSign | Encrypt and sign a text. |
| decrypt | Decrypt a text. |
| selfTest | Return true if we’re able to call GnuPG. |
| kimport | Import a key. |
| kexport | Export a key. |
| refreshKeysFromServer | Syncronize keys with the keyserver |
| sendKeyToServer | Send a key from a keyserver |
| retriveKeyFromServer | Get a key from a keyserver |
| searchKeyInServer | Seach for a key in keyserver |
| changeTrust | Change trust of a key |
| changePassword | Change password of a key |
| generateKey | Generate a new key |
| deleteKey | Delete a key (!) |
| delUid | Delete an identity of a key |
| revokeUid | Revoke an identity of a key |
| addUid | Add a new identity to a key |
| signKey | Sign a key |
| revoqueSign | Deprecated function |
| revokeKey | Revoke a key (!) |
| computeHash | Compute hash of a file |
| runATest | Test if we are currently able to run the a command. |
| tryToFoundTheRightCommand | Do some test to be able to find a working GnuPG executable. |
| FireGPGGPGAccessWindowsXpcom | This class has function for building command lines for GnuPG actions on windows, when the xpcom is available. |
| FireGPGGPGAccessUnixXpcom | This class has function for building command lines for GnuPG actions on linux, when the xpcom is available. |
const XPCOM_STATE_DONTWORK_IN_0_5 = 2; const XPCOM_STATE_DISABLED_IN_0_5 = 3;
const XPCOM_STATE_NEVERTESTED = 0; const XPCOM_STATE_WORKS = 1; const XPCOM_STATE_DONTWORK = 2; const XPCOM_STATE_DISABLED = 3;
This is the main class to access to the gnupg executable.
| Variables | |
| FireGPGCall | The FireGPGCall xpcom. |
| Functions | |
| isUnix | Return true if we are on a unix system, false if we’re on windows. |
| getGPGBonusCommand | Return the custom arguement the user want to add. |
| getGPGCommentArgument | Return a arguement to add a gnupg comment. |
| getGPGCommentArgument | Return a arguement to disable or not the gnupg agent, as set in the options. |
| getGPGTrustArgument | Return a arguement to force gnupg to use not trusted keys. |
| getGPGCommand | Return the command to execute GnuPG |
| getBaseArugments | |
| getProxyInformation | Return the option to set the proxy for keyservers |
| getDiegestAlgo | Return the option to set diegest algo to use for signs hashs |
| getEnv | Return environement parameters |
| runGnupg | Execute gnupg. |
| sign | Sign a text. |
| verify | Verify a text. |
| listkey | List keys. |
| listSigns | List signs. |
| crypt | Encrypt a text. |
| symetric | Symetricaly encrypt a text. |
| cryptAndSign | Encrypt and sign a text. |
| decrypt | Decrypt a text. |
| selfTest | Return true if we’re able to call GnuPG. |
| kimport | Import a key. |
| kexport | Export a key. |
| refreshKeysFromServer | Syncronize keys with the keyserver |
| sendKeyToServer | Send a key from a keyserver |
| retriveKeyFromServer | Get a key from a keyserver |
| searchKeyInServer | Seach for a key in keyserver |
| changeTrust | Change trust of a key |
| changePassword | Change password of a key |
| generateKey | Generate a new key |
| deleteKey | Delete a key (!) |
| delUid | Delete an identity of a key |
| revokeUid | Revoke an identity of a key |
| addUid | Add a new identity to a key |
| signKey | Sign a key |
| revoqueSign | Deprecated function |
| revokeKey | Revoke a key (!) |
| computeHash | Compute hash of a file |
| runATest | Test if we are currently able to run the a command. |
| tryToFoundTheRightCommand | Do some test to be able to find a working GnuPG executable. |
sign: function ( text, password, keyID, notClear, fileMode, fileFrom, fileTo )
Sign a text.
| text | The data to sign |
| password | The password of the private key |
| keyID | The ID of the private key to use. |
| notClear | Do not make a clear sign |
| fileMode | Optional. Indicate the user want to sign a file |
| fileFrom | Optional. The file to sign |
| fileTo | Optional. The file where to put the signature |
A FireGPG.GPGReturn structure.
verify: function( text, charset, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA )
Verify a text.
| text | A text with the GnuPG data to test. |
| charset | Optional, the charset to use |
| fileMode | Optional. Indicate the user want to verify the signature of a file |
| fileFrom | Optional. The file to verify |
| fileSig | Optional. The file with the signature |
A FireGPG.GPGReturn structure.
listkey: function( onlyPrivate )
List keys.
| onlyPrivate | Boolean, set to true if only a private key list is wanted. |
A FireGPG.GPGReturn structure.
crypt: function( text, keyIdList, fromGpgAuth, binFileMode, fileMode, fileFrom, fileTo )
Encrypt a text.
| text | The data to encrypt |
| keyIdList | A key list of recipients |
| fromGpgAuth | Optional. Set this to true if called form GpgAuth |
| binFileMode | Optional. Set this to true if data is binary (no text) |
| fileMode | Optional. Indicate the user want to encrypt a file |
| fileFrom | Optional. The file to encrypt |
| fileTo | Optional. The file where to put the encrypted content |
A FireGPG.GPGReturn structure.
symetric: function( text, password, algo, fileMode, fileFrom, fileTo )
Symetricaly encrypt a text.
| text | The data to encrypt |
| password | The password |
| algo | The cipher used to encrypt |
| fileMode | Indicate the user want to encrypt a file |
| fileFrom | The file to sign |
| fileTo | The file where to put the encrypted file |
A FireGPG.GPGReturn structure.
cryptAndSign: function( text, keyIdList, fromGpgAuth, password, keyID, binFileMode, fileMode, fileFrom, fileTo )
Encrypt and sign a text.
| text | The data to encrypt |
| keyIdList | A key list of recipients |
| fromGpgAuth | Set this to true if called form GpgAuth |
| password | The password of the private key |
| keyID | The ID of the private key to use. |
| binFileMode | Set this to true if data is binary (no text) |
| fileMode | Indicate the user want to encrypt&sign a file |
| fileFrom | The file to sign |
| fileTo | The file where to put the encrypted & signed file |
A FireGPG.GPGReturn structure.
decrypt: function( text, password, binFileMode, fileMode, fileFrom, fileTo )
Decrypt a text.
| text | The data to decrypt |
| password | The password of the private key |
| binFileEncoded | Work on binary data |
| fileMode | Indicate the user want to Decrypt a file |
| fileFrom | The file to decrypt |
| fileTo | The file where to put the decrypted file |
A FireGPG.GPGReturn structure.
kimport: function( text )
Import a key.
| text | A text with the GnuPG data to import. |
A FireGPG.GPGReturn structure.
kexport: function( key )
Export a key.
| key | The key id to export. |
A FireGPG.GPGReturn structure.
Syncronize keys with the keyserver
| server | The key server to use |
A FireGPG.GPGReturn structure.
sendKeyToServer: function( key, server )
Send a key from a keyserver
| keyId | The ked id to send |
| server | The key server to use |
A FireGPG.GPGReturn structure.
retriveKeyFromServer: function( key, server )
Get a key from a keyserver
| keyId | The ked id to get |
| server | The key server to use |
A FireGPG.GPGReturn structure.
searchKeyInServer: function( search, server )
Seach for a key in keyserver
| search | The text to search |
| server | The key server to use |
A FireGPG.GPGReturn structure.
changeTrust: function( key, trustLevel )
Change trust of a key
| key | The key id |
| trustLevel | The new level of trusting |
A FireGPG.GPGReturn structure.
changePassword: function( key, oldpass, newpass )
Change password of a key
| key | The key id |
| oldpass | The old password |
| newpass | The new password |
A FireGPG.GPGReturn structure.
Generate a new key
| name | The name of the key |
| The email of the key | |
| comment | The cpmment of the key |
| password1 | The password of the key |
| password2 | The password of the key |
| keyneverexpire | True if the key shouldn’t expire |
| keyexpirevalue | The expiration value of the key |
| keyexpiretype | The type of the expiration value |
| keylength | The length of the key |
| keytype | The type of the key |
A FireGPG.GPGReturn structure.
deleteKey: function( key )
Delete a key (!)
| key | The key to delete |
A FireGPG.GPGReturn structure.
delUid: function( key, uid )
Delete an identity of a key
| key | The key |
| uid | The uid to delete |
| password | The password of the key |
A FireGPG.GPGReturn structure.
revokeUid: function( key, uid, password, raison )
Revoke an identity of a key
| key | The key |
| uid | The uid to revoke |
| password | The password of the key |
| raison | The raison of the revocation |
A FireGPG.GPGReturn structure.
addUid: function( key, name, email, comment, password )
Add a new identity to a key
| key | The key to revoke |
| name | The name of the new UID |
| The email of the new UID | |
| comment | The comment of the new UID |
| password | The password of the key |
A FireGPG.GPGReturn structure.
signKey: function( key, keyForSign, password )
Sign a key
| key | The key |
| keyForSign | The key used to sign |
| password | The password of the key (used to sign) |
A FireGPG.GPGReturn structure.
revokeKey: function ( key, password, raison )
Revoke a key (!)
| key | The key to revoke |
| raison | The rasion to delete the key |
| password | The password of the key |
A FireGPG.GPGReturn structure.
computeHash: function( hash, file )
Compute hash of a file
| hash | The hash to use (MD5, SHA1, etc.) |
| file | The file |
A FireGPG.GPGReturn structure.
runATest: function( option )
Test if we are currently able to run the a command.
| option | The option to test. |
A FireGPG.GPGReturn structure.
tryToFoundTheRightCommand: function ()
Do some test to be able to find a working GnuPG executable. This function is overwrited by the coresponding function of FireGPGGPGAccessWindowsXpcom or FireGPGGPGAccessUnixXpcom
This class has function for building command lines for GnuPG actions on windows, when the xpcom is available.
Please refer to functions marked as overwrited by this class in FireGPGGPGAccess for the descriptions of this class’s functions.
This class has function for building command lines for GnuPG actions on linux, when the xpcom is available.
Please refer to functions marked as overwrited by this class in FireGPGGPGAccess for the descriptions of this class’s functions.
If we have to disable trusting system of gnupg.
FireGPG.useGPGTrust
The folder of Firefox
FireGPG.Const.CurrentFolder
This function try to load the xpcom.
FireGPG.loadXpcom = function ()
Return true if we should use the agent (option and environement variable set
FireGPG.isGpgAgentActivated = function()
Return true if we are on a unix system, false if we’re on windows.
isUnix: function()
Return the custom arguement the user want to add.
getGPGBonusCommand: function()
Return a arguement to add a gnupg comment.
getGPGCommentArgument: function()
Return a arguement to force gnupg to use not trusted keys.
getGPGTrustArgument: function ( fromGpgAuth, fromDTA )
Return the command to execute GnuPG
getGPGCommand: function ()
getBaseArugments: function ( fromGpgAuth )
Return the option to set the proxy for keyservers
getProxyInformation: function ()
Return the option to set diegest algo to use for signs hashs
getDiegestAlgo: function ()
Return environement parameters
getEnv: function()
Execute gnupg.
runGnupg: function( parameters, sdtIn, charset )
Sign a text.
sign: function ( text, password, keyID, notClear, fileMode, fileFrom, fileTo )
Verify a text.
verify: function( text, charset, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA )
List keys.
listkey: function( onlyPrivate )
Encrypt a text.
crypt: function( text, keyIdList, fromGpgAuth, binFileMode, fileMode, fileFrom, fileTo )
Symetricaly encrypt a text.
symetric: function( text, password, algo, fileMode, fileFrom, fileTo )
Encrypt and sign a text.
cryptAndSign: function( text, keyIdList, fromGpgAuth, password, keyID, binFileMode, fileMode, fileFrom, fileTo )
Decrypt a text.
decrypt: function( text, password, binFileMode, fileMode, fileFrom, fileTo )
Return true if we’re able to call GnuPG.
selfTest: function()
Import a key.
kimport: function( text )
Export a key.
kexport: function( key )
Send a key from a keyserver
sendKeyToServer: function( key, server )
Get a key from a keyserver
retriveKeyFromServer: function( key, server )
Seach for a key in keyserver
searchKeyInServer: function( search, server )
Change trust of a key
changeTrust: function( key, trustLevel )
Change password of a key
changePassword: function( key, oldpass, newpass )
Delete a key (!)
deleteKey: function( key )
Delete an identity of a key
delUid: function( key, uid )
Revoke an identity of a key
revokeUid: function( key, uid, password, raison )
Add a new identity to a key
addUid: function( key, name, email, comment, password )
Sign a key
signKey: function( key, keyForSign, password )
Deprecated function
revoqueSign: function ( key, uid, password )
Revoke a key (!)
revokeKey: function ( key, password, raison )
Compute hash of a file
computeHash: function( hash, file )
Test if we are currently able to run the a command.
runATest: function( option )
Do some test to be able to find a working GnuPG executable.
tryToFoundTheRightCommand: function ()
This function return a basic object, with variable to return informations about a FireGPG’s operation
FireGPG.GPGReturn = function()