Store shared secrets in the database (the crypto component will be

responsible for wrapping/unwrapping them).
This commit is contained in:
akwizgran
2011-08-11 15:41:52 +01:00
parent 07b34cfbab
commit 151a360587
7 changed files with 138 additions and 57 deletions

View File

@@ -58,10 +58,10 @@ public interface DatabaseComponent {
/**
* Adds a new contact to the database with the given transport properties
* and returns an ID for the contact.
* and shared secret, returns an ID for the contact.
*/
ContactId addContact(Map<String, Map<String, String>> transports)
throws DbException;
ContactId addContact(Map<String, Map<String, String>> transports,
byte[] secret) throws DbException;
/** Adds a locally generated message to the database. */
void addLocallyGeneratedMessage(Message m) throws DbException;
@@ -117,6 +117,9 @@ public interface DatabaseComponent {
/** Returns the user's rating for the given author. */
Rating getRating(AuthorId a) throws DbException;
/** Returns the secret shared with the given contact. */
byte[] getSharedSecret(ContactId c) throws DbException;
/** Returns the set of groups to which the user subscribes. */
Collection<Group> getSubscriptions() throws DbException;