| cgpg.js | |
| Constants | |
| FireGPG’s actions results | |
| Functions | |
| FireGPG. | This function return a basic object, with variable to return informations about a FireGPG’s operation |
| FireGPG. | This function return a basic object, who represent a PGP key |
| FireGPG. | This is a function used to sort an array of FireGPG.GPGKey by the key name Use it like this : thearray.sort(Sortage) |
| FireGPG | This is the main kernel for FireGPG, who give access to all GPG functions (sign, encrypt, ...) |
| Functions | |
| sign | Function to sign a text. |
| listSigns | List signatures of a key |
| listKeys | Who return a list of key in the keyring |
| kimport | Function to import a sign. |
| kexport | Function to export a key |
| crypt | Function to encrypt a text. |
| cryptAndSign | Function to encrypt and sign a text. |
| verify | Function to verify signs in a text. |
| layers | Find each layer of a test and verify it (resurcise function) |
| layerverify | Internal, verify a part of a test. |
| decrypt | Function to decrypt a text. |
| initGPGACCESS | Init the FireGPGGPGAccess class (try to found the GnuPG’s command, etc.) |
| selfTest | This if are able to access to a GnuPG executable |
| searchKeyInServer | Seach for a key in keyserver |
| retriveKeyFromServer | Get a key from a keyserver |
| sendKeyToServer | Send a key from a keyserver |
| refreshKeysFromServer | Syncronize keys with the keyserver |
| changeTrust | Change trust of a key |
| changePassword | Change password of a key |
| generateKey | Generate a new key |
| deleteKey | Delete a key (!) |
| revokeKey | Revoke a key (!) |
| addUid | Add a new identity to a key |
| revokeUid | Revoke an identity of a key |
| delUid | Delete an identity of a key |
| signKey | Sign a key |
| computeHash | Compute hash of a file |
| loadFireGPGAccess | This function will determing and ‘build’ the class to access gpg. |
FireGPG.GPGReturn = function()
This function return a basic object, with variable to return informations about a FireGPG’s operation
An object with this variables to null :
| result | The result of the action see FireGPG’s actions results |
| ouput | The output form GnuPG |
| sdOut | The sdOut form GnuPG |
| encrypted | The encrypted data with GnuPG |
| decrypted | The decrypted data with GnuPG |
| signed | The signed data with GnuPG |
| signsresults | An array with FireGPG.GPGReturn data for each sign’s result in the data. |
| signresult | The sign result for the first sign (or the current sign if we’re in the signsresults array) |
| signresulttext | The message for the result of the test on the first sign (or the current sign if we’re in the signsresults array) |
| signresultuser | The username of the key of the first sign (or the current sign if we’re in the signsresults array) |
| signresultdate | The date of the first sign (or the current sign if we’re in the signsresults array) |
| keylist | An array of FireGPG.GPGKey with the key of the specified keyring (private or public) |
| exported | The exported key with GnuPG |
| messagetext | The message who is showed in the lasted alert (usefull when the silent mode is activated) |
FireGPG.GPGKey = function()
This function return a basic object, who represent a PGP key
An object with this variables to null :
| keyName | The key’s name |
| keyExpi | The key’s expire date |
| keyDate | The key’s creation date (ou de la signature) |
| keyId | The key’s id |
| subKeys | An array of FireGPG.GPGKey with the subkey of the key. |
| expired | True if the key is expired |
| revoked | True if the key is revoked |
| keyTrust | Trust of the key |
| fingerPrint | The fingerprint of the ey |
FireGPG.Sortage = function( a, b )
This is a function used to sort an array of FireGPG.GPGKey by the key name Use it like this : thearray.sort(Sortage)
| a | Internal |
| b | Internal |
This is the main kernel for FireGPG, who give access to all GPG functions (sign, encrypt, ...)
| Functions | |
| sign | Function to sign a text. |
| listSigns | List signatures of a key |
| listKeys | Who return a list of key in the keyring |
| kimport | Function to import a sign. |
| kexport | Function to export a key |
| crypt | Function to encrypt a text. |
| cryptAndSign | Function to encrypt and sign a text. |
| verify | Function to verify signs in a text. |
| layers | Find each layer of a test and verify it (resurcise function) |
| layerverify | Internal, verify a part of a test. |
| decrypt | Function to decrypt a text. |
| initGPGACCESS | Init the FireGPGGPGAccess class (try to found the GnuPG’s command, etc.) |
| selfTest | This if are able to access to a GnuPG executable |
| searchKeyInServer | Seach for a key in keyserver |
| retriveKeyFromServer | Get a key from a keyserver |
| sendKeyToServer | Send a key from a keyserver |
| refreshKeysFromServer | Syncronize keys with the keyserver |
| changeTrust | Change trust of a key |
| changePassword | Change password of a key |
| generateKey | Generate a new key |
| deleteKey | Delete a key (!) |
| revokeKey | Revoke a key (!) |
| addUid | Add a new identity to a key |
| revokeUid | Revoke an identity of a key |
| delUid | Delete an identity of a key |
| signKey | Sign a key |
| computeHash | Compute hash of a file |
| loadFireGPGAccess | This function will determing and ‘build’ the class to access gpg. |
sign: function( silent, text, keyID, password, notClear, autoSelectPrivate, wrap, fileMode, fileFrom, fileTo )
Function to sign a text.
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| text | Optional, if not set try to use the selection. The text to sign |
| keyID | Optional, if not set use the default private key or ask the user. The private keyID used to sign. |
| password | Optional, if not set ask the user. |
| notClear | Optional, Do not make a clear sign |
| autoSelectPrivate | Optional. List of private key to preselect |
| wrap | Optional. Wrap signed text |
| 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 |
listKeys: function( onlyPrivate, allKeys, onlySignOfThisKey )
Who return a list of key in the keyring
Return a FireGPG.GPGReturn object.
| onlyPrivate | Optional, default to false. Set this to true to get only the private keys. |
| allKeys | Optional. Return expired and revokey keys too |
| onlySignOfThisKey | Optional. Return only signs of the key |
kimport: function( silent, text, passSecurity )
Function to import a sign.
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| text | Optional, if not set try to use the selection. The text to import |
| passSecurity | Optional, let’s user import anything (like private keys, booo) |
kexport: function( silent, keyID )
Function to export a key
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| keyID | Optional, if not set use ask the user. The public keyID to export |
crypt: function( silent, text, keyIdList, fromGpgAuth, binFileMode, autoSelect, symetrical, password, fileMode, fileFrom, fileTo )
Function to encrypt a text.
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| text | Optional, if not set try to use the selection. The text to encrypt |
| keyIdList | Optional, if not set ask the user. An array of recipients’ keys’ id to encrypt |
| fromGpgAuth | Optional, Default to false. Internal |
| binFileMode | Optional, Default to false. Set this to true if data isensn’t simple text. |
| autoSelect | Optional, An array of recipients’ keys’ id to autoselect on the key’s list selection. |
| symetrical | Optional. Use symetrical encrypt |
| password | Optional. The password for symetrical encryption. |
| 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 |
cryptAndSign: function( silent, text, keyIdList, fromGpgAuth, password, keyID, binFileMode, autoSelect, autoSelectPrivate, fileMode, fileFrom, fileTo )
Function to encrypt and sign a text.
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| text | Optional, if not set try to use the selection. The text to sign |
| keyID | Optional, if not set use the default private key or ask the user. The private keyID used to sign. |
| fromGpgAuth | Optional, Default to false. Internal |
| password | Optional, if not set ask the user. The password of the private key. |
| keyIdList | Optional, if not set ask the user. An array of recipients’ keys’ id to encrypt |
| binFileMode | Optional, Default to false. Set this to true if data isensn’t simple text. |
| autoSelect | Optional, An array of recipients’ keys’ id to autoselect on the key’s list selection. |
| autoSelect | Optional An array of private key to autoselect on key’s list selection. |
| fileMode | Optional. Indicate the user want to encrypt&sign a file |
| fileFrom | Optional. The file to sign |
| fileTo | Optional. The file where to put the encrypted & signed file |
verify: function( silent, text, charset, signData, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA )
Function to verify signs in a text.
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| text | Optional, if not set try to use the selection. The text to verify |
| charset | Optional, the charset to use |
| signData | Deprecated parameter. |
| 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 |
| fileDataForSign | Optional. The data with the signatur |
| fromDTA | Optional. True if called form DTA |
layers: function( text, layer, charset, resultss )
Find each layer of a test and verify it (resurcise function)
Return an array of resultss FireGPG.GPGReturn object.
| text | The text to verify |
| layer | The current layer |
| resultss | Optional. The current array who should be returned. |
layerverify: function( text, layer, division, charset, dontask, fileMode, fileFrom, fileSig, nextText, fileDataForSign, fromDTA )
Internal, verify a part of a test.
Return a FireGPG.GPGReturn object.
| text | The text to verify |
| layer | The current layer |
| division | The current layer level |
| charset | The charset to use |
| dontask | If set to true, don’t ask to download the key |
| 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 |
| nextText | The Gpg output to use for signature verification (used for multi signs) |
| fileDataForSign | Optional. The data with the signatur |
| fromDTA | Optional. True if called form DTA |
decrypt: function( silent, text, password, binFileEncoded, fileMode, fileFrom, fileTo, api )
Function to decrypt a text.
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
| text | Optional, if not set try to use the selection. The text to decrypt. |
| password | Optional, if not set ask the user. The password of the key used to encrypt the data. |
| binFileEncoded | Optional Work on binary data |
| fileMode | Optional. Indicate the user want to Decrypt a file |
| fileFrom | Optional. The file to decrypt |
| fileTo | Optional. The file where to put the decrypted file |
| api | Optional True if it’s a call form the api |
selfTest: function( silent )
This if are able to access to a GnuPG executable
Return a FireGPG.GPGReturn object.
| slient | Optional, default to false. Set this to true to disable any alert for the user |
generateKey: function( silent, name, email, comment, password1, password2, keyneverexpire, keyexpirevalue, keyexpiretype, keylength, keytype )
Generate a new key
| silent | Optional, default to false. Set this to true to disable any alert for the user |
| 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 |
addUid: function ( silent, key, name, email, comment, password )
Add a new identity to a key
| silent | Optional, default to false. Set this to true to disable any alert for the user |
| 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 |
This function return a basic object, with variable to return informations about a FireGPG’s operation
FireGPG.GPGReturn = function()
This function return a basic object, who represent a PGP key
FireGPG.GPGKey = function()
This is a function used to sort an array of FireGPG.GPGKey by the key name Use it like this : thearray.sort(Sortage)
FireGPG.Sortage = function( a, b )
Function to sign a text.
sign: function( silent, text, keyID, password, notClear, autoSelectPrivate, wrap, fileMode, fileFrom, fileTo )
List signatures of a key
listSigns: function( key )
Who return a list of key in the keyring
listKeys: function( onlyPrivate, allKeys, onlySignOfThisKey )
Function to import a sign.
kimport: function( silent, text, passSecurity )
Function to export a key
kexport: function( silent, keyID )
Function to encrypt a text.
crypt: function( silent, text, keyIdList, fromGpgAuth, binFileMode, autoSelect, symetrical, password, fileMode, fileFrom, fileTo )
Function to encrypt and sign a text.
cryptAndSign: function( silent, text, keyIdList, fromGpgAuth, password, keyID, binFileMode, autoSelect, autoSelectPrivate, fileMode, fileFrom, fileTo )
Function to verify signs in a text.
verify: function( silent, text, charset, signData, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA )
Find each layer of a test and verify it (resurcise function)
layers: function( text, layer, charset, resultss )
Internal, verify a part of a test.
layerverify: function( text, layer, division, charset, dontask, fileMode, fileFrom, fileSig, nextText, fileDataForSign, fromDTA )
Function to decrypt a text.
decrypt: function( silent, text, password, binFileEncoded, fileMode, fileFrom, fileTo, api )
Init the FireGPGGPGAccess class (try to found the GnuPG’s command, etc.)
initGPGACCESS: function()
This if are able to access to a GnuPG executable
selfTest: function( silent )
Seach for a key in keyserver
searchKeyInServer: function( search, silent )
Get a key from a keyserver
retriveKeyFromServer: function( keyId, silent )
Send a key from a keyserver
sendKeyToServer: function( keyId, silent )
Syncronize keys with the keyserver
refreshKeysFromServer: function( silent )
Change trust of a key
changeTrust: function( silent, key, trustLevel )
Change password of a key
changePassword: function( silent, key, oldpass, newpass )
Generate a new key
generateKey: function( silent, name, email, comment, password1, password2, keyneverexpire, keyexpirevalue, keyexpiretype, keylength, keytype )
Delete a key (!)
deleteKey: function( silent, key )
Revoke a key (!)
revokeKey: function ( silent, key, raison, password )
Add a new identity to a key
addUid: function ( silent, key, name, email, comment, password )
Revoke an identity of a key
revokeUid: function ( silent, key, uid, password )
Delete an identity of a key
delUid: function ( silent, key, uid )
Sign a key
signKey: function( silent, key, keyForSign, password )
Compute hash of a file
computeHash: function( silent, hash, file )
This function will determing and ‘build’ the class to access gpg.
loadFireGPGAccess: function()