Updated FileReadWriteTest to use the transport component for

encrypting and decrypting packets. Moved the test to the main package
since it's an integration test for several components.
This commit is contained in:
akwizgran
2011-08-12 23:24:24 +02:00
parent a8994a3354
commit 5b6fecfb43
13 changed files with 214 additions and 125 deletions

View File

@@ -1,26 +0,0 @@
package net.sf.briar.api.protocol.writers;
import java.io.InputStream;
import net.sf.briar.api.protocol.Ack;
import net.sf.briar.api.protocol.Batch;
import net.sf.briar.api.protocol.Offer;
import net.sf.briar.api.protocol.Request;
import net.sf.briar.api.protocol.SubscriptionUpdate;
import net.sf.briar.api.protocol.TransportUpdate;
import net.sf.briar.api.serial.ObjectReader;
public interface ProtocolReaderFactory {
ObjectReader<Ack> createAckReader(InputStream in);
ObjectReader<Batch> createBatchReader(InputStream in);
ObjectReader<Offer> createOfferReader(InputStream in);
ObjectReader<Request> createRequestReader(InputStream in);
ObjectReader<SubscriptionUpdate> createSubscriptionReader(InputStream in);
ObjectReader<TransportUpdate> createTransportReader(InputStream in);
}

View File

@@ -15,8 +15,6 @@ import net.sf.briar.api.protocol.TransportUpdate;
*/
public interface PacketReader {
boolean eof() throws IOException;
boolean hasAck() throws IOException;
Ack readAck() throws IOException;

View File

@@ -0,0 +1,9 @@
package net.sf.briar.api.transport;
import java.io.InputStream;
public interface PacketReaderFactory {
PacketReader createPacketReader(byte[] firstTag, InputStream in,
int transportId, long connection, byte[] secret);
}

View File

@@ -2,11 +2,8 @@ package net.sf.briar.api.transport;
import java.io.OutputStream;
import javax.crypto.SecretKey;
public interface PacketWriterFactory {
PacketWriter createPacketWriter(OutputStream out, int transportId,
long connection, SecretKey macKey, SecretKey tagKey,
SecretKey packetKey);
long connection, byte[] secret);
}