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_SHA256VERSION| 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, toNormalizedDoublepublic 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
SSKVerifyExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic Key archivalCopy()
KeyarchivalCopy in class Keypublic void write(java.io.DataOutput _index)
throws java.io.IOException
Keypublic static Key readSSK(java.io.DataInput raf, byte cryptoAlgorithm) throws java.io.IOException
java.io.IOExceptionpublic short getType()
KeyNodeCHK.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.IOExceptionpublic boolean hasPubKey()
public DSAPublicKey getPubKey()
public byte[] getPubKeyHash()
public void setPubKey(DSAPublicKey pubKey2) throws SSKVerifyException
SSKVerifyExceptionpublic byte[] getKeyBytes()
getKeyBytes in class Keypublic byte[] getFullKey()
KeygetFullKey in class Keypublic static NodeSSK construct(byte[] buf) throws SSKVerifyException
SSKVerifyExceptionpublic boolean grabPubkey(GetPubkey pubkeyCache, boolean canReadClientCache, boolean forULPR, BlockMetadata meta)
public static byte[] routingKeyFromFullKey(byte[] keyBuf)
public int compareTo(Key arg0)