public class SigningPrivateKey extends SimpleDataStructure implements Destroyable
SigningPrivateKey provides signature generation capabilities:
Destroyable for secure cleanupSupported Algorithms:
Key Format:
Usage:
SigningPublicKeyDestination identitySecurity Considerations:
destroy() when no longer neededBlinding Support:
BlindData for blinding operationsPerformance Features:
Migration Path:
Thread Safety:
| 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()
Gets the signature type of this private key.
|
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, writeBytespublic SigningPrivateKey()
public SigningPrivateKey(byte[] data)
public SigningPrivateKey(SigType type)
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 SigningPrivateKeyDataFormatExceptionpublic SigningPrivateKey blind(SigningPrivateKey alpha)
alpha - the secret dataUnsupportedOperationException - unless supportedpublic void destroy()
destroy in interface Destroyablepublic boolean equals(Object obj)
SimpleDataStructureequals in class SimpleDataStructurepublic SigType getType()
public int hashCode()
SimpleDataStructurehashCode in class SimpleDataStructurepublic boolean isDestroyed()
isDestroyed in interface Destroyablepublic boolean isOffline()
public int length()
SimpleDataStructurelength in class SimpleDataStructurepublic SigningPublicKey toPublic()
IllegalArgumentException - on bad key or unknown or unsupported typepublic String toString()
toString in class SimpleDataStructure