mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Separated the subject line from the message body.
This commit is contained in:
@@ -10,6 +10,9 @@ public interface Message {
|
||||
static final int MAX_BODY_LENGTH =
|
||||
ProtocolConstants.MAX_PACKET_LENGTH - 1024;
|
||||
|
||||
/** The maximum length of a subject line in UTF-8 bytes. */
|
||||
static final int MAX_SUBJECT_LENGTH = 100;
|
||||
|
||||
/** The maximum length of a signature in bytes. */
|
||||
static final int MAX_SIGNATURE_LENGTH = 100;
|
||||
|
||||
@@ -31,6 +34,9 @@ public interface Message {
|
||||
/** Returns the message's author. */
|
||||
AuthorId getAuthor();
|
||||
|
||||
/** Returns the message's subject line. */
|
||||
String getSubject();
|
||||
|
||||
/** Returns the timestamp created by the message's author. */
|
||||
long getTimestamp();
|
||||
|
||||
|
||||
@@ -7,24 +7,25 @@ import java.security.PrivateKey;
|
||||
public interface MessageEncoder {
|
||||
|
||||
/** Encodes a private message. */
|
||||
Message encodeMessage(MessageId parent, byte[] body) throws IOException,
|
||||
GeneralSecurityException;
|
||||
Message encodeMessage(MessageId parent, String subject, byte[] body)
|
||||
throws IOException, GeneralSecurityException;
|
||||
|
||||
/** Encodes an anonymous message to an unrestricted group. */
|
||||
Message encodeMessage(MessageId parent, Group group, byte[] body)
|
||||
throws IOException, GeneralSecurityException;
|
||||
Message encodeMessage(MessageId parent, Group group, String subject,
|
||||
byte[] body) throws IOException, GeneralSecurityException;
|
||||
|
||||
/** Encodes an anonymous message to a restricted group. */
|
||||
Message encodeMessage(MessageId parent, Group group, PrivateKey groupKey,
|
||||
byte[] body) throws IOException, GeneralSecurityException;
|
||||
String subject, byte[] body) throws IOException,
|
||||
GeneralSecurityException;
|
||||
|
||||
/** Encodes a pseudonymous message to an unrestricted group. */
|
||||
Message encodeMessage(MessageId parent, Group group, Author author,
|
||||
PrivateKey authorKey, byte[] body) throws IOException,
|
||||
GeneralSecurityException;
|
||||
PrivateKey authorKey, String subject, 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)
|
||||
Author author, PrivateKey authorKey, String subject, byte[] body)
|
||||
throws IOException, GeneralSecurityException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user