public class FirstMMRConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
m_bIsClosed |
private int |
m_blocksize |
private MMRDescription |
m_description |
private long |
m_inittimeout |
private java.io.InputStream |
m_istream |
private Mixminion |
m_Mixminion |
private java.io.OutputStream |
m_ostream |
private java.lang.String |
m_protocol |
private TinyTLS |
m_tinyTLS |
private static java.lang.String |
OP_NAME |
Constructor and Description |
---|
FirstMMRConnection(MMRDescription d,
Mixminion a_Mixminion)
constructor
creates a FOR from the description
|
Modifier and Type | Method and Description |
---|---|
void |
close()
closes the connection to the router
|
void |
connect()
connects to the First MixminionRouter (MMR)
|
private void |
createClientCert()
create client certificate for TinyTLS-connection
|
MMRDescription |
getMMRDescription()
returns the description of the onion router
|
boolean |
isClosed()
check if the connection to the first onion router is closed
|
private boolean |
receive(byte[] message,
java.lang.String type)
check answer from server and message-hash
possibel answers: RECEIVE, REJECTED
|
boolean |
send(byte[] message)
connects to first MMR, sends a Message-packet and closes the connection
|
private boolean |
sending(byte[] send,
java.lang.String sendtype)
sends a packet
|
boolean |
sendJunk()
sends a Junk-packet
|
boolean |
sendMessage(byte[] message)
sends a Message-packet
|
private static java.lang.String OP_NAME
private TinyTLS m_tinyTLS
private MMRDescription m_description
private java.io.InputStream m_istream
private java.io.OutputStream m_ostream
private java.lang.String m_protocol
private boolean m_bIsClosed
private long m_inittimeout
private Mixminion m_Mixminion
private int m_blocksize
public FirstMMRConnection(MMRDescription d, Mixminion a_Mixminion)
d
- description of the mixminion routera_Mixminion
- a Mixminion instancepublic MMRDescription getMMRDescription()
public boolean isClosed()
private boolean sending(byte[] send, java.lang.String sendtype) throws java.io.IOException
send
- 32k message as byte arraysendtype
- type of Packet - "Junk" or normal "SEND"java.io.IOException
public boolean send(byte[] message) throws java.io.IOException
send
- 32k message as byte arrayjava.io.IOException
public boolean sendMessage(byte[] message) throws java.io.IOException
send
- 32k message as byte arrayjava.io.IOException
public boolean sendJunk() throws java.io.IOException
java.io.IOException
private boolean receive(byte[] message, java.lang.String type)
message
- 32k Messagetype
- "RECEIVED JUNK" or "RECEIVED"private void createClientCert()
public void connect() throws java.lang.Exception
java.lang.Exception
public void close()
Copyright © 2023. All rights reserved.