Implement BQP transport descriptors

This commit is contained in:
str4d
2016-01-28 23:23:43 +00:00
parent 65316414ea
commit d2d8d9d46e
11 changed files with 347 additions and 14 deletions

View File

@@ -19,4 +19,7 @@ public interface PluginManager {
/** Returns any running duplex plugins that support invitations. */
Collection<DuplexPlugin> getInvitationPlugins();
/** Returns any running duplex plugins that support key agreement. */
Collection<DuplexPlugin> getKeyAgreementPlugins();
}

View File

@@ -2,6 +2,8 @@ package org.briarproject.api.plugins.duplex;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.crypto.PseudoRandom;
import org.briarproject.api.keyagreement.KeyAgreementListener;
import org.briarproject.api.keyagreement.TransportDescriptor;
import org.briarproject.api.plugins.Plugin;
/** An interface for transport plugins that support duplex communication. */
@@ -24,4 +26,19 @@ public interface DuplexPlugin extends Plugin {
*/
DuplexTransportConnection createInvitationConnection(PseudoRandom r,
long timeout, boolean alice);
/** Returns true if the plugin supports short-range key agreement. */
boolean supportsKeyAgreement();
/**
* Returns a listener that can be used to perform key agreement.
*/
KeyAgreementListener createKeyAgreementListener(byte[] localCommitment);
/**
* Attempts to connect to the remote peer specified in the given descriptor.
* Returns null if no connection can be established within the given time.
*/
DuplexTransportConnection createKeyAgreementConnection(
byte[] remoteCommitment, TransportDescriptor d, long timeout);
}