public class NodeCHK extends Key
Modifier and Type | Field and Description |
---|---|
static byte |
BASE_TYPE |
static short |
FULL_KEY_LENGTH
32 bytes for hash, 2 bytes for type
|
static int |
KEY_LENGTH |
ALGO_AES_CTR_256_SHA256, ALGO_AES_PCFB_256_SHA256
VERSION
Constructor and Description |
---|
NodeCHK(byte[] routingKey2,
byte cryptoAlgorithm) |
Modifier and Type | Method and Description |
---|---|
Key |
archivalCopy()
Get a copy of the key with any unnecessary information stripped, for long-term
in-memory storage.
|
Key |
cloneKey() |
int |
compareTo(Key arg0) |
static byte |
cryptoAlgorithmFromFullKey(byte[] fullKey) |
boolean |
equals(java.lang.Object key) |
byte[] |
getFullKey()
Get the full key, including any crypto type bytes, everything needed to construct a Key object
|
byte[] |
getRoutingKey() |
short |
getType()
Get key type
High 8 bit ((type >> 8) & 0xFF) is the base type (
BASE_TYPE or
NodeSSK.BASE_TYPE ). |
int |
hashCode() |
static Key |
readCHK(java.io.DataInput raf,
byte algo) |
static byte[] |
routingKeyFromFullKey(byte[] keyBuf) |
java.lang.String |
toString() |
void |
write(java.io.DataOutput _index)
Write to disk.
|
void |
writeToDataOutputStream(java.io.DataOutputStream stream) |
compress, createBlock, createKeyBlock, getKeyBytes, isValidCryptoAlgorithm, read, toNormalizedDouble
public static final short FULL_KEY_LENGTH
public static final int KEY_LENGTH
public static final byte BASE_TYPE
public final void writeToDataOutputStream(java.io.DataOutputStream stream) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public final void write(java.io.DataOutput _index) throws java.io.IOException
Key
public static Key readCHK(java.io.DataInput raf, byte algo) throws java.io.IOException
java.io.IOException
public short getType()
Key
BASE_TYPE
or
NodeSSK.BASE_TYPE
).
Key.ALGO_AES_PCFB_256_SHA256
is supported).
public byte[] getRoutingKey()
getRoutingKey
in class Key
public byte[] getFullKey()
Key
getFullKey
in class Key
public static byte cryptoAlgorithmFromFullKey(byte[] fullKey)
public static byte[] routingKeyFromFullKey(byte[] keyBuf)
public int compareTo(Key arg0)
public Key archivalCopy()
Key
archivalCopy
in class Key