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_BYTESDefault key size in bytes (20 for DSA-SHA1). |
_data| Constructor and Description |
|---|
SigningPrivateKey()Creates a new SigningPrivateKey with the default DSA-SHA1 type. |
SigningPrivateKey(byte[] data)Creates a new SigningPrivateKey from byte data with default type. |
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()Hash code combining the type and data. |
boolean | isDestroyed()javax.security.auth.Destroyable interface |
boolean | isOffline()Constant time |
int | length()Key length in bytes, determined by the signature type. |
SigningPublicKey | toPublic()Converts this signing private key to its public equivalent. |
String | toString()Returns a string representation of this data structure. |
calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytespublic static final int KEYSIZE_BYTES
public 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 SimpleDataStructureobj - the object to comparepublic SigType getType()
public int hashCode()
hashCode in class SimpleDataStructurepublic boolean isDestroyed()
isDestroyed in interface Destroyablepublic boolean isOffline()
public int length()
length in class SimpleDataStructurepublic SigningPublicKey toPublic()
IllegalArgumentException - on bad key or unknown or unsupported typepublic String toString()
SimpleDataStructuretoString in class SimpleDataStructure