Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
jio
Commits
086d8dd9
Commit
086d8dd9
authored
Aug 09, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cryptstorage: fix confusing code example
parent
cb009081
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
src/jio.storage/cryptstorage.js
src/jio.storage/cryptstorage.js
+22
-17
No files found.
src/jio.storage/cryptstorage.js
View file @
086d8dd9
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment