mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Each connection's keys are derived from a secret that is erased after deriving the keys and the secret for the next connection.
31 lines
803 B
Java
31 lines
803 B
Java
package net.sf.briar.transport;
|
|
|
|
import java.util.Map;
|
|
|
|
import net.sf.briar.api.crypto.CryptoComponent;
|
|
import net.sf.briar.api.protocol.TransportIndex;
|
|
import net.sf.briar.api.transport.ConnectionWindow;
|
|
import net.sf.briar.api.transport.ConnectionWindowFactory;
|
|
|
|
import com.google.inject.Inject;
|
|
|
|
class ConnectionWindowFactoryImpl implements ConnectionWindowFactory {
|
|
|
|
private final CryptoComponent crypto;
|
|
|
|
@Inject
|
|
ConnectionWindowFactoryImpl(CryptoComponent crypto) {
|
|
this.crypto = crypto;
|
|
}
|
|
|
|
public ConnectionWindow createConnectionWindow(TransportIndex i,
|
|
byte[] secret) {
|
|
return new ConnectionWindowImpl(crypto, i, secret);
|
|
}
|
|
|
|
public ConnectionWindow createConnectionWindow(TransportIndex i,
|
|
Map<Long, byte[]> unseen) {
|
|
return new ConnectionWindowImpl(crypto, i, unseen);
|
|
}
|
|
}
|