public class NodeSSK extends Key
Modifier and Type | Field and Description |
---|---|
static byte |
BASE_TYPE |
static int |
E_H_DOCNAME_SIZE |
static int |
FULL_KEY_LENGTH |
static int |
PUBKEY_HASH_SIZE |
static int |
ROUTING_KEY_LENGTH |
static int |
SSK_VERSION |
ALGO_AES_CTR_256_SHA256, ALGO_AES_PCFB_256_SHA256
VERSION
Constructor and Description |
---|
NodeSSK(byte[] pkHash,
byte[] ehDocname,
byte cryptoAlgorithm) |
NodeSSK(byte[] pkHash,
byte[] ehDocname,
DSAPublicKey pubKey,
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 NodeSSK |
construct(byte[] buf) |
boolean |
equals(java.lang.Object o) |
byte[] |
getFullKey()
Get the full key, including any crypto type bytes, everything needed to construct a Key object
|
byte[] |
getKeyBytes() |
DSAPublicKey |
getPubKey() |
byte[] |
getPubKeyHash() |
short |
getType()
Get key type
High 8 bit ((type >> 8) & 0xFF) is the base type (
NodeCHK.BASE_TYPE or
BASE_TYPE ). |
boolean |
grabPubkey(GetPubkey pubkeyCache,
boolean canReadClientCache,
boolean forULPR,
BlockMetadata meta) |
int |
hashCode() |
boolean |
hasPubKey() |
static Key |
readSSK(java.io.DataInput raf,
byte cryptoAlgorithm) |
static byte[] |
routingKeyFromFullKey(byte[] keyBuf) |
void |
setPubKey(DSAPublicKey pubKey2) |
java.lang.String |
toString() |
void |
write(java.io.DataOutput _index)
Write to disk.
|
void |
writeToDataOutputStream(java.io.DataOutputStream stream) |
compress, createBlock, createKeyBlock, getRoutingKey, isValidCryptoAlgorithm, read, toNormalizedDouble
public static final int SSK_VERSION
public static final int PUBKEY_HASH_SIZE
public static final int E_H_DOCNAME_SIZE
public static final byte BASE_TYPE
public static final int FULL_KEY_LENGTH
public static final int ROUTING_KEY_LENGTH
public NodeSSK(byte[] pkHash, byte[] ehDocname, byte cryptoAlgorithm)
public NodeSSK(byte[] pkHash, byte[] ehDocname, DSAPublicKey pubKey, byte cryptoAlgorithm) throws SSKVerifyException
SSKVerifyException
public java.lang.String toString()
toString
in class java.lang.Object
public Key archivalCopy()
Key
archivalCopy
in class Key
public void write(java.io.DataOutput _index) throws java.io.IOException
Key
public static Key readSSK(java.io.DataInput raf, byte cryptoAlgorithm) throws java.io.IOException
java.io.IOException
public short getType()
Key
NodeCHK.BASE_TYPE
or
BASE_TYPE
).
Key.ALGO_AES_PCFB_256_SHA256
is supported).
public void writeToDataOutputStream(java.io.DataOutputStream stream) throws java.io.IOException
java.io.IOException
public boolean hasPubKey()
public DSAPublicKey getPubKey()
public byte[] getPubKeyHash()
public void setPubKey(DSAPublicKey pubKey2) throws SSKVerifyException
SSKVerifyException
public byte[] getKeyBytes()
getKeyBytes
in class Key
public byte[] getFullKey()
Key
getFullKey
in class Key
public static NodeSSK construct(byte[] buf) throws SSKVerifyException
SSKVerifyException
public boolean grabPubkey(GetPubkey pubkeyCache, boolean canReadClientCache, boolean forULPR, BlockMetadata meta)
public static byte[] routingKeyFromFullKey(byte[] keyBuf)
public int compareTo(Key arg0)