1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

Set private key from asn1 on initial set

This commit is contained in:
Kyle Spearrin 2017-03-09 20:59:10 -05:00
parent 290cbe6b55
commit e7707c4826

View File

@ -16,9 +16,9 @@ angular
_service.setPrivateKey = function (privateKeyCt, key) {
try {
var privateKey = _service.decrypt(privateKeyCt, key, 'raw');
_privateKey = privateKey;
$sessionStorage.privateKey = forge.util.encode64(privateKey);
var privateKeyBytes = _service.decrypt(privateKeyCt, key, 'raw');
$sessionStorage.privateKey = forge.util.encode64(privateKeyBytes);
_privateKey = forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(privateKeyBytes));;
}
catch (e) {
console.log('Cannot set private key. Decryption failed.');