WIP test
This commit is contained in:
parent
e109550d9b
commit
39e85396db
7 changed files with 123 additions and 42 deletions
|
|
@ -230,11 +230,22 @@ Storage.prototype.clearAll = function(cb) {
|
|||
this.db.clear(cb);
|
||||
};
|
||||
|
||||
Storage.prototype.decrypt = function(base64, password) {
|
||||
// password
|
||||
Storage.prototype.decrypt = function(base64, password, iterations) {
|
||||
|
||||
if (password) {
|
||||
this.storage.savePassphrase();
|
||||
var opts = iterations ? {iterations: iterations} : {};
|
||||
|
||||
this.storage.setPassword(password, opts);
|
||||
}
|
||||
|
||||
var decryptedStr = this._decrypt(base64);
|
||||
return JSON.parse(decryptedStr);
|
||||
var ret = JSON.parse(decryptedStr);
|
||||
|
||||
if (password)
|
||||
this.storage.restorePassphrase();
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
Storage.prototype.encrypt = function(obj) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue