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:
parent
290cbe6b55
commit
e7707c4826
@ -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.');
|
||||
|
Loading…
Reference in New Issue
Block a user