mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Add isTrustedIdentity to SignalProtocolStore
Adds a new required storage method for the protocol library. // FREEBIE
This commit is contained in:
@@ -29,6 +29,19 @@ SignalProtocolStore.prototype = {
|
||||
delete this.store[key];
|
||||
},
|
||||
|
||||
isTrustedIdentity: function(identifier, identityKey) {
|
||||
if (identifier === null || identifier === undefined) {
|
||||
throw new error("tried to check identity key for undefined/null key");
|
||||
}
|
||||
if (!(identityKey instanceof ArrayBuffer)) {
|
||||
throw new error("Expected identityKey to be an ArrayBuffer");
|
||||
}
|
||||
var trusted = this.get('identityKey' + identifier);
|
||||
if (trusted === undefined) {
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
return Promise.resolve(identityKey === trusted);
|
||||
},
|
||||
loadIdentityKey: function(identifier) {
|
||||
if (identifier === null || identifier === undefined)
|
||||
throw new Error("Tried to get identity key for undefined/null key");
|
||||
|
||||
Reference in New Issue
Block a user