diff --git a/index.html b/index.html index f94bb7d..39effc7 100644 --- a/index.html +++ b/index.html @@ -116,7 +116,7 @@ - + @@ -226,7 +226,7 @@
- Let extractKey be a key equal to n zero bits where
- n is the size of the output of the hash function described by the
- hash
member of
- normalizedAlgorithm.
-
- Let keyDerivationKey be the secret represented by [[handle]]
internal slot of key
- as the message.
+ Let keyDerivationKey be the secret represented by [[handle]]
internal slot of key.
- the hash
member of
+ the hash
member of
normalizedAlgorithm as Hash,
var encoder = new TextEncoder('utf-8');
+ var encoder = new TextEncoder('utf-8');
// Algorithm Object
var algorithmKeyGen = {
name: "RSASSA-PKCS1-v1_5",
// RsaHashedKeyGenParams
modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+ publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
hash: {
name: "SHA-256"
}
@@ -13582,23 +13573,23 @@ Web Cryptography API
name: "RSASSA-PKCS1-v1_5"
};
-window.crypto.subtle.generateKey(algorithmKeyGen, false, ["sign"]).then(
- function(key) {
- var dataPart1 = encoder.encode("hello,");
- var dataPart2 = encoder.encode(" world!");
+window.crypto.subtle.generateKey(algorithmKeyGen, false, ["sign"]).then(
+ function(key) {
+ var dataPart1 = encoder.encode("hello,");
+ var dataPart2 = encoder.encode(" world!");
- return window.crypto.subtle.sign(algorithmSign, key.privateKey, [dataPart1, dataPart2]);
+ return window.crypto.subtle.sign(algorithmSign, key.privateKey, [dataPart1, dataPart2]);
},
- console.error.bind(console, "Unable to generate a key")
-).then(
- console.log.bind(console, "The signature is: "),
- console.error.bind(console, "Unable to sign")
+ console.error.bind(console, "Unable to generate a key")
+).then(
+ console.log.bind(console, "The signature is: "),
+ console.error.bind(console, "Unable to sign")
);
var encoder = new TextEncoder('utf-8');
-var clearDataArrayBufferView = encoder.encode("Plain Text Data");
+ var encoder = new TextEncoder('utf-8');
+var clearDataArrayBufferView = encoder.encode("Plain Text Data");
var aesAlgorithmKeyGen = {
name: "AES-CBC",
@@ -13609,16 +13600,16 @@ Web Cryptography API
var aesAlgorithmEncrypt = {
name: "AES-CBC",
// AesCbcParams
- iv: window.crypto.getRandomValues(new Uint8Array(16))
+ iv: window.crypto.getRandomValues(new Uint8Array(16))
};
// Create a key generator to produce a one-time-use AES key to encrypt some data
-window.crypto.subtle.generateKey(aesAlgorithmKeyGen, false, ["encrypt"]).then(
- function(aesKey) {
- return window.crypto.subtle.encrypt(aesAlgorithmEncrypt, aesKey, clearDataArrayBufferView);
+window.crypto.subtle.generateKey(aesAlgorithmKeyGen, false, ["encrypt"]).then(
+ function(aesKey) {
+ return window.crypto.subtle.encrypt(aesAlgorithmEncrypt, aesKey, clearDataArrayBufferView);
}
-).then(console.log.bind(console, "The ciphertext is: "),
- console.error.bind(console, "Unable to encrypt"));
+).then(console.log.bind(console, "The ciphertext is: "),
+ console.error.bind(console, "Unable to encrypt"));