Sign the message with the group's private key if the group is

restricted, and check the signature if it should be present.
This commit is contained in:
akwizgran
2011-07-25 21:54:49 +01:00
parent 3f61d0c3df
commit a86ef2142f
4 changed files with 139 additions and 72 deletions

View File

@@ -6,10 +6,21 @@ import java.security.PrivateKey;
public interface MessageEncoder {
/** Encodes an anonymous to an unrestricted group. */
Message encodeMessage(MessageId parent, Group group, byte[] body)
throws IOException;
throws IOException, GeneralSecurityException;
/** Encodes an anonymous message to a restricted group. */
Message encodeMessage(MessageId parent, Group group, PrivateKey groupKey,
byte[] body) throws IOException, GeneralSecurityException;
/** Encodes a pseudonymous message to an unrestricted group. */
Message encodeMessage(MessageId parent, Group group, Author author,
PrivateKey privateKey, byte[] body) throws IOException,
PrivateKey authorKey, byte[] body) throws IOException,
GeneralSecurityException;
/** Encode a pseudonymous message to a restricted group. */
Message encodeMessage(MessageId parent, Group group, PrivateKey groupKey,
Author author, PrivateKey authorKey, byte[] body)
throws IOException, GeneralSecurityException;
}