public class SigningPrivateKey extends SimpleDataStructure implements Destroyable
Modifier and Type | Field and Description |
---|---|
static int |
KEYSIZE_BYTES |
_data
Constructor and Description |
---|
SigningPrivateKey() |
SigningPrivateKey(byte[] data) |
SigningPrivateKey(SigType type) |
SigningPrivateKey(SigType type,
byte[] data) |
SigningPrivateKey(String base64Data)
constructs from base64
|
Modifier and Type | Method and Description |
---|---|
SigningPrivateKey |
blind(SigningPrivateKey alpha)
Only for SigType EdDSA_SHA512_Ed25519
|
void |
destroy()
javax.security.auth.Destroyable interface
|
boolean |
equals(Object obj)
Warning - this returns true for two different classes with the same size
and same data, e.g.
|
SigType |
getType() |
int |
hashCode()
We assume the data has enough randomness in it, so use the first 4 bytes for speed.
|
boolean |
isDestroyed()
javax.security.auth.Destroyable interface
|
boolean |
isOffline()
Constant time
|
int |
length()
The legal length of the byte array in this data structure
|
SigningPublicKey |
toPublic()
Converts this signing private key to its public equivalent.
|
String |
toString() |
calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytes
public SigningPrivateKey()
public SigningPrivateKey(SigType type)
public SigningPrivateKey(byte[] data)
public SigningPrivateKey(SigType type, byte[] data)
public SigningPrivateKey(String base64Data) throws DataFormatException
base64Data
- a string of base64 data (the output of .toBase64() called
on a prior instance of SigningPrivateKeyDataFormatException
public int length()
SimpleDataStructure
length
in class SimpleDataStructure
public SigType getType()
public SigningPublicKey toPublic()
IllegalArgumentException
- on bad key or unknown or unsupported typepublic SigningPrivateKey blind(SigningPrivateKey alpha)
alpha
- the secret dataUnsupportedOperationException
- unless supportedpublic boolean isOffline()
public void destroy()
destroy
in interface Destroyable
public boolean isDestroyed()
isDestroyed
in interface Destroyable
public String toString()
toString
in class SimpleDataStructure
public int hashCode()
SimpleDataStructure
hashCode
in class SimpleDataStructure
public boolean equals(Object obj)
SimpleDataStructure
equals
in class SimpleDataStructure