public void setIdentityKey(string name, IdentityKey identityKey, string accountId) { dB.InsertOrReplace(new OmemoIdentityKeyTable { id = OmemoIdentityKeyTable.generateId(name, accountId), name = name, accountId = accountId, identityKey = identityKey.serialize() }); }
public IdentityKey getIdentityKey(string name, string accountId) { List <OmemoIdentityKeyTable> list = dB.Query <OmemoIdentityKeyTable>(true, "SELECT * FROM " + DBTableConsts.OMEMO_IDENTITY_KEY_TABLE + " WHERE id = ?;", OmemoIdentityKeyTable.generateId(name, accountId)); if (list.Count <= 0) { return(null); } return(new IdentityKey(list[0].identityKey, 0)); }
public void deleteIdentityKey(string name, string accountId) { dB.Execute("DELETE FROM " + DBTableConsts.OMEMO_IDENTITY_KEY_TABLE + " WHERE id = ?;", OmemoIdentityKeyTable.generateId(name, accountId)); }
public bool containsIdentityKey(string name, string accountId) { List <OmemoIdentityKeyTable> list = dB.Query <OmemoIdentityKeyTable>(true, "SELECT * FROM " + DBTableConsts.OMEMO_IDENTITY_KEY_TABLE + " WHERE id = ?;", OmemoIdentityKeyTable.generateId(name, accountId)); return(list.Count > 0); }