Commit 086d8dd9 authored by Romain Courteaud's avatar Romain Courteaud

Cryptstorage: fix confusing code example

parent cb009081
...@@ -10,24 +10,29 @@ ...@@ -10,24 +10,29 @@
(function (jIO, RSVP, DOMException, Blob, crypto, Uint8Array, ArrayBuffer) { (function (jIO, RSVP, DOMException, Blob, crypto, Uint8Array, ArrayBuffer) {
"use strict"; "use strict";
/*
The cryptography system used by this storage is AES-GCM.
Here is an example of how to generate a key to the json format:
// you the cryptography system used by this storage is AES-GCM. return new RSVP.Queue()
// here is an example of how to generate a key to the json format. .push(function () {
return crypto.subtle.generateKey({name: "AES-GCM", length: 256},
// var key, true, ["encrypt", "decrypt"]);
// jsonKey; })
// crypto.subtle.generateKey({name: "AES-GCM",length: 256}, .push(function (key) {
// (true), ["encrypt", "decrypt"]) return crypto.subtle.exportKey("jwk", key);
// .then(function(res){key = res;}); })
// .push(function (json_key) {
// window.crypto.subtle.exportKey("jwk", key) var jio = jIO.createJIO({
// .then(function(res){jsonKey = val}) type: "crypt",
// key: json_key,
//var storage = jIO.createJIO({type: "crypt", key: jsonKey, sub_storage: {storage_definition}
// sub_storage: {...}}); });
});
// find more informations about this cryptography system on
// https://github.com/diafygi/webcrypto-examples#aes-gcm Find more informations about this cryptography system on
https://github.com/diafygi/webcrypto-examples#aes-gcm
*/
/** /**
* The JIO Cryptography Storage extension * The JIO Cryptography Storage extension
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment