mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
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:
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
9
api/net/sf/briar/api/transport/PacketReaderFactory.java
Normal file
9
api/net/sf/briar/api/transport/PacketReaderFactory.java
Normal 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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user