Removed salt from unrestricted groups: two unrestricted groups with

the same name will now be treated as the same group (this seems more
intuitive than the alternative).
This commit is contained in:
akwizgran
2011-07-25 20:11:32 +01:00
parent b1f27757df
commit 586d1739ae
8 changed files with 34 additions and 102 deletions

View File

@@ -1,7 +1,5 @@
package net.sf.briar.api.protocol;
import java.security.PublicKey;
import net.sf.briar.api.serial.Writable;
/** A group to which users may subscribe. */
@@ -13,22 +11,9 @@ public interface Group extends Writable {
/** Returns the group's name. */
String getName();
/**
* Returns true if messages sent to the group must be signed with a
* particular private key.
*/
boolean isRestricted();
/**
* If the group is restricted, returns null. Otherwise returns a salt
* value that is combined with the group's name to generate its unique
* identifier.
*/
byte[] getSalt();
/**
* If the group is restricted, returns the public key that is used to
* authorise all messages sent to the group. Otherwise returns null.
*/
PublicKey getPublicKey();
byte[] getPublicKey();
}

View File

@@ -2,6 +2,5 @@ package net.sf.briar.api.protocol;
public interface GroupFactory {
Group createGroup(GroupId id, String name, boolean restricted,
byte[] saltOrKey);
Group createGroup(GroupId id, String name, byte[] publicKey);
}