How can I store associated array in chrome local storage, and retrieve that in the same format? I want to save "identityKeyPair", which is in the form
identityKeyPair -> { pubKey: ArrayBuffer, privKey: ArrayBuffer }
I tried the below things. But not working out. I am getting [Object Object] on trying to retrieve it.
Saving to local storage
chrome.storage.sync.set({'identityKeyPair': JSON.stringify(identityKeyPair)}, function() {
alert('identityKeyPair saved');
});
Trying to retrieve
chrome.storage.sync.get(["identityKeyPair"], function(items){
if (items.identityKeyPair) {
alert(JSON.parse(items.identityKeyPair).pubKey);
}