FireGPG.Api

Class who manage link between FireGPG and the website who use the api

Summary
FireGPG.ApiClass who manage link between FireGPG and the website who use the api
Functions
onLoadInit api features when a new page is loaded
listenerUnloadRemove all api listeners
helloReturn ‘firegpg-ok’ in ‘result’ (useful to test firegpg’s api presence)
authReturn ‘auth-ok’ in ‘result’ (or ‘auth-fail’ is the website have rights to use the api
registerTry to register a webpage (ask the user).
getDataNodeReturn the node with data attributes for return
listkeyReturn ‘list-ok’ in ‘result’ (or ‘list-err’ is there is a problem), and the list of public key in list
listprivkeyReturn ‘list-ok’ in ‘result’ (or ‘list-err’ is there is a problem), and the list of private key in list
checkReturn ‘check-ok’ in ‘result’ (or ‘check-err’ is there is a problem) if the sign is valid.
signReturn ‘sign-ok’ in ‘result’ (or ‘sign-err’ is there is a problem) if makeing a sign was successfull Return in ‘text’ a signed text
signandencryptReturn ‘signandencrypt-ok’ in ‘result’ (or ‘signandencrypt-err’ is there is a problem) if makeing a signed and encrypted text was successfull Return in ‘text’ the encrypted text
encryptReturn ‘encrypt-ok’ in ‘result’ (or ‘encrypt-err’ is there is a problem) if makeing a ecnrypted text was successfull Return in ‘text’ the encrypted text
decryptReturn ‘decrypt-ok’ in ‘result’ (or ‘decrypt-err’ is there is a problem) if trying to decrypt a text was successfull Return in ‘text’ the decrypted text
removeDoublePointChange # to #1, : to #2 and , to #3 in a string
getReturnDataNodeReturn the node with data attributes for return
registerAuthenticate a domain|website|page and return the api key
denyRegisterDeny futur registrations from a domain|website|page
canRegisterReturn true if the user have right to try toregister to use FireGPG’s api
isAuthReturn true if the user have right to use FireGPG’s api
getDomainGet the current domain for the page, or the webpage if we’re in local (file://)
getAccessListReturn the list of access
setAccessListSet a new list of access

Functions

onLoad

onLoad: function()

Init api features when a new page is loaded

listenerUnload

listenerUnload: function(event)

Remove all api listeners

hello

hello: function (event)

Return ‘firegpg-ok’ in ‘result’ (useful to test firegpg’s api presence)

auth

auth: function (event)

Return ‘auth-ok’ in ‘result’ (or ‘auth-fail’ is the website have rights to use the api

Paramters

auth_keythe key for the website

register

register: function (event)

Try to register a webpage (ask the user).  Put ‘register-ok’ in ‘result’ or ‘register-fail’.  It’s all is ok, put the auth key in ‘auth_key’

getDataNode

getDataNode: function(d)

Return the node with data attributes for return

listkey

listkey: function (event)

Return ‘list-ok’ in ‘result’ (or ‘list-err’ is there is a problem), and the list of public key in list

Paramters

auth_key’the key for the website

listprivkey

listprivkey: function (event)

Return ‘list-ok’ in ‘result’ (or ‘list-err’ is there is a problem), and the list of private key in list

Paramters

auth_keythe key for the website

check

check: function (event)

Return ‘check-ok’ in ‘result’ (or ‘check-err’ is there is a problem) if the sign is valid.

Return

in ‘ckeck-infos’ info on sign

Paramters

auth_keythe key for the website
textthe text to check

sign

sign: function (event)

Return ‘sign-ok’ in ‘result’ (or ‘sign-err’ is there is a problem) if makeing a sign was successfull Return in ‘text’ a signed text

Paramters

auth_keythe key for the website
textthe text to check
force-keyoptional, to force the gpg’s key to use

signandencrypt

signandencrypt: function (event)

Return ‘signandencrypt-ok’ in ‘result’ (or ‘signandencrypt-err’ is there is a problem) if makeing a signed and encrypted text was successfull Return in ‘text’ the encrypted text

Paramters

auth_keythe key for the website
textthe text to check
keysthe keys list
force-keyoptional, to force the gpg’s key to use

encrypt

encrypt: function (event)

Return ‘encrypt-ok’ in ‘result’ (or ‘encrypt-err’ is there is a problem) if makeing a ecnrypted text was successfull Return in ‘text’ the encrypted text

Paramters

auth_keythe key for the website
textthe text to check
keysthe keys list

decrypt

decrypt: function (event)

Return ‘decrypt-ok’ in ‘result’ (or ‘decrypt-err’ is there is a problem) if trying to decrypt a text was successfull Return in ‘text’ the decrypted text

Paramters

auth_keythe key for the website
textthe text to decrypt

removeDoublePoint

removeDoublePoint: function(s)

Change # to #1, : to #2 and , to #3 in a string

getReturnDataNode

getReturnDataNode: function(d)

Return the node with data attributes for return

register

Authenticate a domain|website|page and return the api key

denyRegister

denyRegister: function(theLocation,
type)

Deny futur registrations from a domain|website|page

canRegister

canRegister: function(theLocation)

Return true if the user have right to try toregister to use FireGPG’s api

isAuth

isAuth: function(key,
document)

Return true if the user have right to use FireGPG’s api

getDomain

getDomain: function(url)

Get the current domain for the page, or the webpage if we’re in local (file://)

getAccessList

getAccessList: function()

Return the list of access

setAccessList

setAccessList: function(arrayy)

Set a new list of access

onLoad: function()
Init api features when a new page is loaded
listenerUnload: function(event)
Remove all api listeners
hello: function (event)
Return ‘firegpg-ok’ in ‘result’ (useful to test firegpg’s api presence)
auth: function (event)
Return ‘auth-ok’ in ‘result’ (or ‘auth-fail’ is the website have rights to use the api
register: function (event)
Try to register a webpage (ask the user).
getDataNode: function(d)
Return the node with data attributes for return
listkey: function (event)
Return ‘list-ok’ in ‘result’ (or ‘list-err’ is there is a problem), and the list of public key in list
listprivkey: function (event)
Return ‘list-ok’ in ‘result’ (or ‘list-err’ is there is a problem), and the list of private key in list
check: function (event)
Return ‘check-ok’ in ‘result’ (or ‘check-err’ is there is a problem) if the sign is valid.
sign: function (event)
Return ‘sign-ok’ in ‘result’ (or ‘sign-err’ is there is a problem) if makeing a sign was successfull Return in ‘text’ a signed text
signandencrypt: function (event)
Return ‘signandencrypt-ok’ in ‘result’ (or ‘signandencrypt-err’ is there is a problem) if makeing a signed and encrypted text was successfull Return in ‘text’ the encrypted text
encrypt: function (event)
Return ‘encrypt-ok’ in ‘result’ (or ‘encrypt-err’ is there is a problem) if makeing a ecnrypted text was successfull Return in ‘text’ the encrypted text
decrypt: function (event)
Return ‘decrypt-ok’ in ‘result’ (or ‘decrypt-err’ is there is a problem) if trying to decrypt a text was successfull Return in ‘text’ the decrypted text
removeDoublePoint: function(s)
Change # to #1, : to #2 and , to #3 in a string
getReturnDataNode: function(d)
Return the node with data attributes for return
denyRegister: function(theLocation,
type)
Deny futur registrations from a domain|website|page
canRegister: function(theLocation)
Return true if the user have right to try toregister to use FireGPG’s api
isAuth: function(key,
document)
Return true if the user have right to use FireGPG’s api
getDomain: function(url)
Get the current domain for the page, or the webpage if we’re in local (file://)
getAccessList: function()
Return the list of access
setAccessList: function(arrayy)
Set a new list of access
Close