Skip to content

Instantly share code, notes, and snippets.

@abeluck
Created November 1, 2018 13:24
Show Gist options
  • Save abeluck/0cd7e8ce37863749d44ca5c7e90a02cf to your computer and use it in GitHub Desktop.
Save abeluck/0cd7e8ce37863749d44ca5c7e90a02cf to your computer and use it in GitHub Desktop.
SignalProtocolStore interface
function SignalProtocolStore(path) {
}
SignalProtocolStore.prototype = {
Direction: {
SENDING: 1,
RECEIVING: 2,
},
// create a random group id that we haven't seen before.
generateNewGroupId() {
},
getIdentityKeyPair() {
},
getLocalRegistrationId() {
},
put(key, value) {
},
get(key, defaultValue) {
},
remove(key) {
},
clear() {
},
isTrustedIdentity(identifier, identityKey, direction) {
},
loadIdentityKey(identifier) {
},
saveIdentity(identifier, identityKey, nonblockingApproval) {
},
isNonBlockingApprovalRequired(identityRecord) {
},
saveIdentityWithAttributes(identifier, attributes) {
},
/* Returns a prekeypair object or undefined */
loadPreKey(keyId) {
},
storePreKey(keyId, keyPair) {
},
removePreKey(keyId) {
},
clearPreKeyStore() {
},
/* Returns a signed keypair object or undefined */
loadSignedPreKey(keyId) {
},
loadSignedPreKeys() {
},
storeSignedPreKey(keyId, keyPair) {
},
removeSignedPreKey(keyId) {
},
clearSignedPreKeysStore() {
},
getDeviceIds(number) {
},
loadSession(identifier) {
},
storeSession(identifier, record) {
},
removeSession(identifier) {
},
removeAllSessions(identifier) {
},
archiveSiblingSessions(identifier) {
},
clearSessionStore() {
},
// Groups
getGroup(groupId) {
},
putGroup(groupId, group) {
},
removeGroup(groupId) {
},
// Not yet processed messages - for resiliency
getAllUnprocessed() {
},
countUnprocessed() {
},
removeAllUnprocessed() {
},
getUnprocessed(id) {
},
addUnprocessed(data) {
},
updateUnprocessed(id, updates) {
},
removeUnprocessed(id) {
},
// USER STORAGE
userSetNumberAndDeviceId(number, deviceId, deviceName) {
},
userGetNumber() {
},
userGetDeviceId() {
},
userGetDeviceName() {
},
// GROUP STORAGE
groupsCreateNewGroup(numbers, groupId) {
},
groupsGetNumbers(groupId) {
},
groupsRemoveNumber(groupId, number) {
},
groupsAddNumbers(groupId, numbers) {
},
groupsDeleteGroup(groupId) {
},
groupsGetGroup(groupId) {
},
groupsUpdateNumbers(groupId, numbers) {
},
}
module.exports = SignalProtocolStore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment