DOM Reference Manual | All Packages | All Classes | Index | Frames | ||
Crypto | Properties | Methods | ||
Package | dom.objects |
Class | public class Crypto |
Inheritance | Crypto Object |
Non-standard (Mozilla)
See also
Property | Defined By | ||
---|---|---|---|
Non-Standard enableSmartCardEvents : Boolean
To enable your document to receive these events, you must first tell the crypto system you are interested. | Crypto | ||
Non-Standard version : DOMString [read-only]
Undocumented
| Crypto |
Method | Defined By | ||
---|---|---|---|
Undocumented
| Crypto | ||
Non-Standard disableRightClick():void
Undocumented
| Crypto | ||
Non-Standard generateCRMFRequest(requestedDN:DOMString, regToken:DOMString, authenticator:DOMString, escrowAuthorityCert:DOMString, CRMFGenerationDoneCode:DOMString, keySizeN:Number, keyParamsN:DOMString, keyGenAlgN:DOMString):CRMFRequest
This method will generate a sequence of CRMF requests that has N requests. | Crypto | ||
Non-Standard importUserCertificates(nicknameString:DOMString, certString:DOMString, forceBackup:Boolean):DOMString
Imports newly issued certificates for the user. | Crypto | ||
Non-Standard logout():void
Undocumented
| Crypto | ||
The popChallengeResponse() function returns a proof of key posession signed challenge which a CA can use
to verify the client has the private key associated with it's claimed public key. | Crypto | ||
Generates a random number of numBytes length. | Crypto | ||
Undocumented
| Crypto |
enableSmartCardEvents | property |
enableSmartCardEvents:Boolean
Non-standard (Mozilla)
To enable your document to receive these events, you must first tell the crypto system you are interested. You
can do this by setting window.crypto.enableSmartCardEvents
to true
. This tells the
crypto system that you are interested in listening for these events. You can then register event handlers for
these events with the document.addEventListener.
public function get enableSmartCardEvents():Boolean
public function set enableSmartCardEvents(value:Boolean):void
See also
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> .... <script language="javascript"> function onSmartCardChange() { window.location.reload(); } function register() { window.crypto.enableSmartCardEvents=true; document.addEventListener("smartcard-insert",onSmartCardChange,false); document.addEventListener("smartcard-remove",onSmartCardChange,false); }; function deregister() { document.removeEventListener("smartcard-insert",onSmartCardChange,false); document.removeEventListener("smartcard-remove",onSmartCardChange,false); }; </script> </head> <body .... onload=register() onunload=deregister()> ..... </body> </html>
version | property |
version:DOMString
[read-only] Non-standard (Mozilla)
Undocumented
public function get version():DOMString
See also
alert | () | method |
public function alert(message:DOMString):void
Non-standard (Mozilla)
Undocumented
Parameters
message:DOMString |
See also
disableRightClick | () | method |
public function disableRightClick():void
Non-standard (Mozilla)
Undocumented
See also
generateCRMFRequest | () | method |
public function generateCRMFRequest(requestedDN:DOMString, regToken:DOMString, authenticator:DOMString, escrowAuthorityCert:DOMString, CRMFGenerationDoneCode:DOMString, keySizeN:Number, keyParamsN:DOMString, keyGenAlgN:DOMString):CRMFRequest
Non-standard (Mozilla)
This method will generate a sequence of CRMF requests that has N requests. One request for each key pair that is generated. The first three parameters will be applied to every request. The "escrowAuthorityCert" parameter will only be used for requests that pertain to a key that is being escrowed. After the "escrowAuthorityCert" parameter, the method takes some JavaScript code that is invoked when the CRMF request is ready. Finally, there are 1 or more sets of key generation arguments. Each key generation will be associated with its own request. All the requests will have the same DN.
Parameters
requestedDN:DOMString — An RFC 1485 formatted DN to include in the certificate request.
| |
regToken:DOMString — A value used to authenticate the user to the RA/CA.
| |
authenticator:DOMString — A value that the user can authenticate with in the future when
their private key is not available. Can be used for key recovery or revocation requests.
| |
escrowAuthorityCert:DOMString — If this value is NULL, then no key escrow will be performed.
This value specifies which KRA certificate should be used to wrap the private key being
escrowed. The user will be prompted for confirmation whenever a key will be escrowed.
Only key exchange keys will be escrowed. If a dual use key is being generated, it will
not be escrowed. The value of this argument is a base-64 encoded certificate.
| |
CRMFGenerationDoneCode:DOMString — This parameter is JavaScript to execute when the CRMF generation is complete.
| |
keySizeN:Number — The size in bits of the Nth key to generate
| |
keyParamsN:DOMString — This string is an optional algorithm dependent parameter value. For
Diffie-Hellman it is used to specify p and g parameters. For DSA, it will be used to
specify pqg. If the key generation requires parameters and the value passed in is NULL,
then the client will generate the parameters on its own. Currently, this value is ignored.
| |
keyGenAlgN:DOMString — Which algorithm the generated key will support. Acceptable values are (the
mentioned values for keyUsage pertain to the keyUsage value of the Certificate Extension that
will ultimately be in the issued certificate):
|
CRMFRequest —
|
See also
var crmfObject = null; try { crmfObject = window.crypto.generateCRMFRequest("CN=vvv", "regToken", null, null, 'f' , 1024, null, "rsa-dual-use"); } catch(ex) { console.log("window.crypto.generateCRMFRequest() failed - " + ex + "\n"); } function f() { console.log("done"); } console.log(crmfObject);
importUserCertificates | () | method |
public function importUserCertificates(nicknameString:DOMString, certString:DOMString, forceBackup:Boolean):DOMString
Non-standard (Mozilla)
Imports newly issued certificates for the user. The private key for the certificates must already reside in the user's personal private key database. The request ID in the response being imported must match the request ID in the associated Certification Request or Recovery Request.
Parameters
nicknameString:DOMString — This is the nickname that will be used to describe the certificate in the
client's certificate management UI. It should serve to uniquely identify the certificate to the user.
For example, "John Smith's VeriSign Class 3 Digital ID" or "John Smith's Ford ID Certificate". However,
if this certificate has the same DN as one or more certificates that already exist in the user's
certificate store, the nickname associated with the certificate(s) of the same DN in the certificate
store is used, and the "nicknameString" parameter is ignored. If the string is null and no certificate
with the same DN exists in the user's certificate store, Personal Security Manager uses the following
pattern to derive the nickname: <Common Name>'s <Issuer Name> ID.
| |
certString:DOMString — This string is the CMMF Certification Response from the CA that contains the user's certificate(s). The response is base-64 encoded.
| |
forceBackup:Boolean — It allows the CA or RA to indicate to the client whether to force the user to back up a newly issued certificate (PKCS #12).
|
DOMString — If the import operation succeeds, an empty string will be returned. If it fails, one of
the following error strings will be returned:
|
See also
logout | () | method |
popChallengeResponse | () | method |
public function popChallengeResponse(challengeString:DOMString):DOMString
Non-standard (Mozilla)
The popChallengeResponse() function returns a proof of key posession signed challenge which a CA can use to verify the client has the private key associated with it's claimed public key.
Parameters
challengeString:DOMString — A base-64 encoded CMMF POPODecKeyChallContent message. The current implementation
does not conform to that defined in the CMMF draft, and we intend to change this implementation to that
defined in the CMC RFC. See below for the current implementation.
|
DOMString — The resultString will either be a base-64 encoded POPODecKeyRespContent message, or one of the
following error strings:
|
See also
resultString = crypto.popChallengeResponse("challengeString");
random | () | method |
public function random(numBytes:Number):DOMString
Non-standard (Mozilla)
Generates a random number of numBytes length.
Note (Mozilla): window.crypto.random() is not yet implemented in Mozilla browsers.
Parameters
numBytes:Number |
DOMString |
See also
var myrandom = window.crypto.random(10);
signText | () | method |
public function signText(stringToSign:DOMString, caOption:DOMString):DOMString
Non-standard (Mozilla)
Undocumented
Parameters
stringToSign:DOMString | |
caOption:DOMString |
DOMString |
See also