public class Header
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private int |
HASH_LEN |
private int |
HEADER_LEN |
private byte[] |
m_header |
private int |
MIN_SH |
private int |
PK_ENC_LEN |
private int |
PK_MAX_DATA_LEN |
private int |
PK_OVERHEAD_LEN |
private byte[] |
VERSION_MAJOR |
| Constructor and Description |
|---|
Header(java.util.Vector path,
java.util.Vector secrets,
ExitInformation exitInfo)
CONSTRUCTOR
|
| Modifier and Type | Method and Description |
|---|---|
private byte[] |
buildHeader(java.util.Vector path,
java.util.Vector secrets,
ExitInformation exitInfo)
builds a header with the specified hops
|
byte[] |
getAsByteArray()
Gives back the header as byteArray
|
private byte[] |
makeFSHS(byte[] v,
byte[] sk,
byte[] d,
byte[] rs,
short rt)
fixed-size part of the subheader structure
|
private byte[] |
makeSHS(byte[] V,
byte[] SK,
byte[] D,
byte[] RS,
short RT,
byte[] RI)
entire subheader
|
private int |
max(int first,
int second)
Compares two int values and returns the larger one
|
private byte[] |
pk_encrypt(MyRSAPublicKey key,
byte[] m)
PublicKey Encryption of
|
private byte[] |
subKey(byte[] secretKey,
java.lang.String phrase)
Subkey
|
private final int HEADER_LEN
private final int PK_ENC_LEN
private final int PK_OVERHEAD_LEN
private final int PK_MAX_DATA_LEN
private final int HASH_LEN
private final int MIN_SH
private byte[] VERSION_MAJOR
private byte[] m_header
public Header(java.util.Vector path,
java.util.Vector secrets,
ExitInformation exitInfo)
hops - recipient - private byte[] buildHeader(java.util.Vector path,
java.util.Vector secrets,
ExitInformation exitInfo)
hops - intrecipient - Stringpublic byte[] getAsByteArray()
private byte[] subKey(byte[] secretKey,
java.lang.String phrase)
Secret - Key byte[]phrase - Stringprivate byte[] makeFSHS(byte[] v,
byte[] sk,
byte[] d,
byte[] rs,
short rt)
version - byte[]secretkey - byte[]digest - byte[]routingsize - byte[]routingtype - byte[]private byte[] makeSHS(byte[] V,
byte[] SK,
byte[] D,
byte[] RS,
short RT,
byte[] RI)
Version - byte[]SecretKey - byte[]Digest - byte[]RoutingSize - byte[]RoutingType - byte[]RoutingInformation - byte[]private int max(int first,
int second)
first - intsecond - intprivate byte[] pk_encrypt(MyRSAPublicKey key, byte[] m)
key - MyRSAPublicKeym - byte[]Copyright © 2023. All rights reserved.