Fixed keyring local storage
This commit is contained in:
parent
3b1955627b
commit
875ccf5196
|
@ -42,7 +42,7 @@ LocalStore.prototype.load = function () {
|
|||
if (armoredKeys !== null && armoredKeys.length !== 0) {
|
||||
var key;
|
||||
for (var i = 0; i < armoredKeys.length; i++) {
|
||||
key = openpgp.key.readArmored(armoredKeys[i]);
|
||||
key = openpgp.key.readArmored(armoredKeys[i]).keys[0];
|
||||
keys.push(key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,6 +77,15 @@ describe("Keyring", function() {
|
|||
expect(keys).to.exist.and.have.length(1);
|
||||
done();
|
||||
});
|
||||
it('store keys in localstorage', function(done){
|
||||
keyring.store();
|
||||
done();
|
||||
});
|
||||
it('after loading from localstorage: getKeysForKeyId() - valid id', function(done) {
|
||||
var keyring = new openpgp.Keyring(),
|
||||
keys = keyring.getKeysForKeyId(keyId.toLowerCase());
|
||||
expect(keys).to.exist.and.have.length(1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user