Add method for deriving rendezvous key.

This commit is contained in:
akwizgran
2019-05-22 15:06:26 +01:00
parent 3820d7413c
commit 5d2252ebda
3 changed files with 53 additions and 5 deletions

View File

@@ -1,9 +1,27 @@
package org.briarproject.bramble.api.rendezvous;
import static java.util.concurrent.TimeUnit.DAYS;
public interface RendezvousConstants {
/**
* Label for deriving key material from the master key.
* The current version of the rendezvous protocol.
*/
byte PROTOCOL_VERSION = 0;
/**
* How long to try to rendezvous with a pending contact before giving up.
*/
long RENDEZVOUS_TIMEOUT_MS = DAYS.toMillis(2);
/**
* Label for deriving the rendezvous key from the handshake key pairs.
*/
String RENDEZVOUS_KEY_LABEL =
"org.briarproject.bramble.rendezvous/RENDEZVOUS_KEY";
/**
* Label for deriving key material from the rendezvous key.
*/
String KEY_MATERIAL_LABEL =
"org.briarproject.bramble.rendezvous/KEY_MATERIAL";

View File

@@ -1,12 +1,19 @@
package org.briarproject.bramble.api.rendezvous;
import org.briarproject.bramble.api.crypto.KeyPair;
import org.briarproject.bramble.api.crypto.PublicKey;
import org.briarproject.bramble.api.crypto.SecretKey;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.TransportId;
import java.security.GeneralSecurityException;
@NotNullByDefault
public interface RendezvousCrypto {
KeyMaterialSource createKeyMaterialSource(SecretKey masterKey,
SecretKey deriveRendezvousKey(PublicKey theirPublicKey, KeyPair ourKeyPair)
throws GeneralSecurityException;
KeyMaterialSource createKeyMaterialSource(SecretKey rendezvousKey,
TransportId t);
}