Serializable, DataStructurepublic class PrivateKey extends SimpleDataStructure
| Modifier and Type | Field | Description |
|---|---|---|
static int |
KEYSIZE_BYTES |
_data| Constructor | Description |
|---|---|
PrivateKey() |
|
PrivateKey(byte[] data) |
|
PrivateKey(String base64Data) |
constructs from base64
|
| Modifier and Type | Method | 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
|
readclone, finalize, getClass, notify, notifyAll, wait, wait, waitcalculateHash, fromBase64, fromByteArray, getData, readBytes, setData, toBase64, toByteArray, toString, writeBytespublic 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 PrivateKeyDataFormatExceptionpublic int length()
SimpleDataStructurelength in class SimpleDataStructurepublic PublicKey toPublic()
IllegalArgumentException - on bad keypublic int hashCode()
hashCode in class SimpleDataStructurepublic boolean equals(Object obj)
SimpleDataStructureequals in class SimpleDataStructure