Implement handshake manager.

This commit is contained in:
akwizgran
2019-05-27 14:54:05 +01:00
parent 60155f146a
commit 24f1b7eeca
7 changed files with 360 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package org.briarproject.bramble.api.contact;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.duplex.DuplexTransportConnection;
import org.briarproject.bramble.api.transport.StreamWriter;
import java.io.IOException;
import java.io.InputStream;
@NotNullByDefault
public interface HandshakeManager {
/**
* Handshakes and exchanges pseudonyms with the given pending contact,
* converts the pending contact to a contact and returns the contact.
*
* @param in An incoming stream for the handshake, which must be secured in
* handshake mode
* @param out An outgoing stream for the handshake, which must be secured
* in handshake mode
* @param conn The connection to use for the handshake and contact exchange
*/
Contact handshakeAndAddContact(PendingContactId p,
InputStream in, StreamWriter out, DuplexTransportConnection conn)
throws DbException, IOException;
}