mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Refactor KeyManager and TagRecogniser. #55
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package org.briarproject.api.transport;
|
||||
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
|
||||
/**
|
||||
* Contains transport keys for sending streams to a given contact over a given
|
||||
* transport in a given rotation period.
|
||||
*/
|
||||
public class OutgoingKeys {
|
||||
|
||||
private final SecretKey tagKey, headerKey;
|
||||
private final long rotationPeriod, streamCounter;
|
||||
|
||||
public OutgoingKeys(SecretKey tagKey, SecretKey headerKey,
|
||||
long rotationPeriod) {
|
||||
this(tagKey, headerKey, rotationPeriod, 0);
|
||||
}
|
||||
|
||||
public OutgoingKeys(SecretKey tagKey, SecretKey headerKey,
|
||||
long rotationPeriod, long streamCounter) {
|
||||
this.tagKey = tagKey;
|
||||
this.headerKey = headerKey;
|
||||
this.rotationPeriod = rotationPeriod;
|
||||
this.streamCounter = streamCounter;
|
||||
}
|
||||
|
||||
public SecretKey getTagKey() {
|
||||
return tagKey;
|
||||
}
|
||||
|
||||
public SecretKey getHeaderKey() {
|
||||
return headerKey;
|
||||
}
|
||||
|
||||
public long getRotationPeriod() {
|
||||
return rotationPeriod;
|
||||
}
|
||||
|
||||
public long getStreamCounter() {
|
||||
return streamCounter;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user