public class PrivateKey extends SimpleDataStructure
Modifier and Type | Field and Description |
---|---|
static int |
KEYSIZE_BYTES |
_data
Constructor and Description |
---|
PrivateKey() |
PrivateKey(byte[] data) |
PrivateKey(String base64Data)
constructs from base64
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Warning - this returns true for two different classes with the same size
and same data, e.g.
|
int |
hashCode()
We assume the data has enough randomness in it, so use the last 4 bytes for speed.
|
int |
length()
The legal length of the byte array in this data structure
|
PublicKey |
toPublic()
derives a new PublicKey object derived from the secret contents
of this PrivateKey
|
calculateHash, fromBase64, fromByteArray, getData, readBytes, setData, toBase64, toByteArray, toString, writeBytes
read
public static final int KEYSIZE_BYTES
public PrivateKey()
public PrivateKey(byte[] data)
public PrivateKey(String base64Data) throws DataFormatException
base64Data
- a string of base64 data (the output of .toBase64() called
on a prior instance of PrivateKeyDataFormatException
public int length()
SimpleDataStructure
length
in class SimpleDataStructure
public PublicKey toPublic()
IllegalArgumentException
- on bad keypublic int hashCode()
hashCode
in class SimpleDataStructure
public boolean equals(Object obj)
SimpleDataStructure
equals
in class SimpleDataStructure