add #toEncryptedObj
This commit is contained in:
parent
e3107c85ac
commit
e1b9f4f859
3 changed files with 40 additions and 2 deletions
|
|
@ -333,9 +333,24 @@ Identity.prototype.closeWallet = function(wid, cb) {
|
|||
};
|
||||
|
||||
|
||||
Identity.prototype.toObj = function(wid, cb) {
|
||||
/**
|
||||
* @desc Return a base64 encrypted version of the wallet
|
||||
* @return {string} base64 encoded string
|
||||
*/
|
||||
Identity.prototype.toEncryptedObj = function() {
|
||||
var ret = {};
|
||||
ret.iterations = this.storage.iterations;
|
||||
ret.wallets = {};
|
||||
|
||||
_.each(this.openWallets, function(w){
|
||||
ret.wallets[w.getId()] = w.toEncryptedObj();
|
||||
});
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @desc This method prepares options for a new Wallet
|
||||
*
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ Storage.prototype.restorePassphrase = function() {
|
|||
throw new Error('NOSTOREDPASSPHRASE: No stored passphrase');
|
||||
|
||||
this._setPassphrase(this.savedPassphrase[this.__uniqueid].pps, this.savedPassphrase[this.__uniqueid].iterations);
|
||||
this.savedPassphrase[this.__uniqueid] = undefined;
|
||||
};
|
||||
|
||||
Storage.prototype.hasPassphrase = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue