public class RelayCell extends Cell
Modifier and Type | Field and Description |
---|---|
private boolean |
m_digestGenerated |
private byte |
m_relayCommand |
private java.lang.Integer |
m_streamID |
static byte |
RELAY_BEGIN |
static byte |
RELAY_CONNECTED |
static byte |
RELAY_DATA |
static byte |
RELAY_DROP |
static byte |
RELAY_END |
static byte |
RELAY_EXTEND |
static byte |
RELAY_EXTENDED |
static byte |
RELAY_RESOLVE |
static byte |
RELAY_RESOLVED |
static byte |
RELAY_SENDME |
static byte |
RELAY_TRUNCATE |
static byte |
RELAY_TRUNCATED |
CELL_PAYLOAD_SIZE, CELL_SIZE, m_payload
Constructor and Description |
---|
RelayCell()
Constructor for a relay cell
|
RelayCell(int circID)
Constructor for a relay cell
|
RelayCell(int circID,
byte[] payload,
int offset)
Constructor for a relay cell
|
RelayCell(int circID,
byte relaycommand,
int streamid,
byte[] data)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
checkDigest(mybouncycastle.org.bouncycastle.crypto.digests.SHA1Digest digest)
checks if the digest of the relay cell is correct
|
private static byte[] |
createPayload(byte relaycommand,
int streamid,
byte[] data) |
void |
doCryptography(MyAES engine)
encode the cell
|
void |
generateDigest(mybouncycastle.org.bouncycastle.crypto.digests.SHA1Digest digest)
generates the digest for the relay cell
|
byte[] |
getCellData()
creates a fixed-sized cell
2 bytes - circID 1 byte - command 509 bytes - payload |
byte |
getRelayCommand()
gets the command of the relay cell
|
byte[] |
getRelayPayload()
gets the payload of the relay cell
|
java.lang.Integer |
getStreamID()
gets the streamID of the relay cell
|
createCell, getCircuitID, getCommand, getPayload, setPayload
public static final byte RELAY_BEGIN
public static final byte RELAY_DATA
public static final byte RELAY_END
public static final byte RELAY_CONNECTED
public static final byte RELAY_SENDME
public static final byte RELAY_EXTEND
public static final byte RELAY_EXTENDED
public static final byte RELAY_TRUNCATE
public static final byte RELAY_TRUNCATED
public static final byte RELAY_DROP
public static final byte RELAY_RESOLVE
public static final byte RELAY_RESOLVED
private byte m_relayCommand
private java.lang.Integer m_streamID
private boolean m_digestGenerated
public RelayCell()
public RelayCell(int circID)
circID
- circIDpublic RelayCell(int circID, byte[] payload, int offset)
circID
- circIDpayload
- payloadoffset
- offsetpublic RelayCell(int circID, byte relaycommand, int streamid, byte[] data)
circID
- circIDrelaycommand
- relaycommandstreamid
- streamIDdata
- datapublic byte getRelayCommand()
public java.lang.Integer getStreamID()
public void generateDigest(mybouncycastle.org.bouncycastle.crypto.digests.SHA1Digest digest)
digest
- digestpublic void checkDigest(mybouncycastle.org.bouncycastle.crypto.digests.SHA1Digest digest) throws java.lang.Exception
digest
- digestjava.lang.Exception
- if an error occurspublic void doCryptography(MyAES engine) throws java.lang.Exception
engine
- a cipherjava.lang.Exception
private static byte[] createPayload(byte relaycommand, int streamid, byte[] data)
public byte[] getCellData()
Cell
getCellData
in class Cell
public byte[] getRelayPayload()
Copyright © 2023. All rights reserved.