Fixes import & export with new encryption

This commit is contained in:
Esteban Ordano 2014-10-28 00:31:30 -03:00
commit 35bab383b0
12 changed files with 86 additions and 67 deletions

View file

@ -35,6 +35,19 @@ Compatibility._getWalletIds = function(cb) {
return cb(walletIds);
};
/**
* @param {string} encryptedWallet - base64-encoded encrypted wallet
* @param {string} passphrase - base64-encoded passphrase
* @returns {Object}
*/
Compatibility.importLegacy = function(encryptedWallet, passphrase) {
var ret = Compatibility._decrypt(encryptedWallet, passphrase);
if (!ret) return null;
ret = ret.toString(CryptoJS.enc.Utf8);
ret = JSON.parse(ret);
return ret;
};
/**
* Decrypts using the CryptoJS library (unknown encryption schema)
*