crypto object
Represents the security object of the Firefox browser. The crypto object allows access to various browser security and cryptographic features.
Syntax:
Properties that reference the object:
| window.crypto |
The base interface, through which you can add new functionalities to the crypto object, is the Crypto interface.
Possible members:
Properties:
Sets or retrieves a Boolean value that indicates whether the document recieves SmartCard events.
This property is read/write. |
|||||||
Returns a string that specifies the version number of the crypto object.
This property is read-only. |
Methods:
alert (message) |
|
Displays an alert window with the specified message and an OK button. The support for this method has been removed in Firefox 3.5.
Parameters:
Return value:
This method has no return value.
|
|||||||||||||||||||||||||||||
disableRightClick ( ) |
Disables the right mouse click. Not Implemented yet.
Return value:
This method has no return value.
|
||||||||||||||||||||||||||||||
generateCRMFRequest (requestedDN, regToken, authenticator, escrowAuthorityCert, doneCode, keySize1, keyParams1, keyGenAlg1 [, ...[, keySizeN, keyParamsN, keyGenAlgN]]) |
Generates a CRMF (Certificate Request Message Format) request.
For detailed information, please visit this site: GenerateCRMFRequest method (Mozilla Developer Center)
Return value:
Returns a CRMF Request object.
|
||||||||||||||||||||||||||||||
importUserCertificates (nickname, cmmfResponse, forceToBackUp) |
Imports a certificate for the user.
For detailed information, please visit this site: importUserCertificates method (Mozilla Developer Center)
Parameters:
Return value:
Returns an empty string on success, else returns a string that specifies the error message.
|
||||||||||||||||||||||||||||||
logout ( ) |
Logs the user out.
Return value:
This method has no return value.
|
||||||||||||||||||||||||||||||
popChallengeResponse (challenge) |
For detailed information, please visit this site: PopChallengeResponse method (Mozilla Developer Center)
Parameters:
Return value:
Returns a string that identifies the base-64 encoded response string or an error message if fails.
|
||||||||||||||||||||||||||||||
random (numBytes) |
Generates a random number. Not implemented yet.
Parameters:
Return value:
Returns the generated number.
|
Example HTML code 1:
This example illustrates the use of the crypto object:
|
||||
<head> <script type="text/javascript"> function Notify () { if (window.crypto) { crypto.alert ("The operation was successful!"); } else { alert ("Your browser does not support the crypto object!"); } } </script> </head> <body> <button onclick="Notify ()">Create an alert window</button> </body> |
||||
|
||||
Did you find this example helpful?
|
External links:
User Contributed Comments