public class ReplyBlock
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static int |
KEY_LEN |
(package private) static long |
KEY_LIFETIME |
private byte[] |
m_headerbytes |
private byte[] |
m_longterm_secret |
private java.lang.String |
m_myaddress |
private RoutingInformation |
m_myrouting |
private java.util.Vector |
m_path |
private byte[] |
m_sharedSecret |
private long |
m_timetolive |
Constructor and Description |
---|
ReplyBlock(RoutingInformation routingInfo,
byte[] header,
byte[] sharedsecret,
long time)
Constructor 2
used to instantiate a ReplyBlock Object,
used to parse a ReplyBlock out of a message
call parseReplyBlock(String) to complete iT!
|
ReplyBlock(java.lang.String myaddress,
java.util.Vector path,
byte[] usersecret)
Constructor 1
used to build a replyblock, which is appended to a message
call build() to complete it!
|
Modifier and Type | Method and Description |
---|---|
void |
buildBlock()
builds the replyHeader
|
private static int |
byteToInt(byte[] b,
int offset)
Calculates the int value of a given ByteArray
|
byte[] |
getHeaderBytes()
Returns the ReplyHeader as Bytes
|
byte[] |
getReplyBlockasBytes()
Returns the Replyblock as described underwards
|
java.lang.String |
getReplyBlockasString() |
RoutingInformation |
getRouting()
Returns the RoutingInformation of the First Server in the Path of the ReplyBlock, needed for the Crossover-Point
|
byte[] |
getSharedSecret()
Returns the End-to End shared Secret
|
static java.util.Vector |
parseReplyBlocks(java.lang.String message,
byte[] block)
Parses a given payload for a ReplyBlock and returns it,
return null, when no ReplyBlock is detected
|
static java.lang.String |
removeRepyBlocks(java.lang.String message)
Removes a ascii-armored replyblock from a given payload
|
boolean |
timetoliveIsOK()
tests whether the replyblock is not older then 3 months
|
static final int KEY_LEN
static final long KEY_LIFETIME
private byte[] m_sharedSecret
private java.util.Vector m_path
private byte[] m_longterm_secret
private RoutingInformation m_myrouting
private byte[] m_headerbytes
private java.lang.String m_myaddress
private long m_timetolive
public ReplyBlock(java.lang.String myaddress, java.util.Vector path, byte[] usersecret)
myadress
- path
- usersecret
- public ReplyBlock(RoutingInformation routingInfo, byte[] header, byte[] sharedsecret, long time)
routingInfo
- header
- sharedsecret
- time
- public void buildBlock()
public byte[] getHeaderBytes()
public byte[] getSharedSecret()
public byte[] getReplyBlockasBytes()
public java.lang.String getReplyBlockasString()
public RoutingInformation getRouting()
public static java.util.Vector parseReplyBlocks(java.lang.String message, byte[] block) throws java.io.IOException
message
- block
- java.io.IOException
public static java.lang.String removeRepyBlocks(java.lang.String message) throws java.io.IOException
message
- java.io.IOException
public boolean timetoliveIsOK()
private static int byteToInt(byte[] b, int offset)
b
- offset
- Copyright © 2023. All rights reserved.