9 var algorithmKeyGen = {
10 name: "RSASSA-PKCS1-v1_5",
13 publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
18 name: "RSASSA-PKCS1-v1_5",
19 params: { hash: { name: "SHA-256" } }
22 var crypto = this.crypto;
24 crypto.generateKey(algorithmKeyGen, false, ["sign"]).
27 // Because we are not supplying data to .sign(), a multi-part
28 // CryptoOperation will be returned, which requires us to call
29 // .process() and .finish(), both of which return futures. We return
30 // the future for the eventual finished operation.
31 return crypto.sign(algorithmSign, result.privateKey).
32 process(convertPlainTextToArrayBufferView("hello,")).
33 process(convertPlainTextToArrayBufferView(" world!")).
36 function(err) { console.error("Unable to generate a key."); }
39 function(result) { console.log("The signature is: ", result); }
40 function(err) {console.error("Unable to sign:", err); }