public class SigningPublicKey extends SimpleDataStructure
SigningPublicKey provides signature verification capabilities:
Supported Algorithms:
Key Format:
Usage:
SigningPrivateKeyDestination identityPerformance Features:
Security Considerations:
Blinding Support:
BlindData for blindingMigration Path:
Thread Safety:
| Modifier and Type | Field and Description |
|---|---|
static int |
KEYSIZE_BYTES |
_data| Constructor and Description |
|---|
SigningPublicKey() |
SigningPublicKey(byte[] data) |
SigningPublicKey(SigType type) |
SigningPublicKey(SigType type,
byte[] data) |
SigningPublicKey(String base64Data)
constructs from base64
|
| Modifier and Type | Method and Description |
|---|---|
SigningPublicKey |
blind(SigningPrivateKey alpha)
Only for SigType EdDSA_SHA512_Ed25519
|
static void |
clearCache()
Clears the public key cache.
|
static SigningPublicKey |
create(byte[] data,
int off)
Pull from cache or return new.
|
static SigningPublicKey |
create(InputStream in)
Pull from cache or return new
|
boolean |
equals(Object obj)
Warning - this returns true for two different classes with the same size
and same data, e.g.
|
byte[] |
getPadding(KeyCertificate kcert)
Get the portion of this (type 0) SPK that is really padding based on the Key Cert type given,
if any
|
SigType |
getType()
Gets the signature type of this public key.
|
int |
hashCode()
We assume the data has enough randomness in it, so use the first 4 bytes for speed.
|
int |
length()
The legal length of the byte array in this data structure
|
String |
toString() |
(package private) SigningPublicKey |
toTypedKey(KeyCertificate kcert)
Up-convert this from an untyped (type 0) SPK to a typed SPK based on the Key Cert given.
|
(package private) void |
writeTruncatedBytes(OutputStream out)
Write the data up to a max of 128 bytes.
|
calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytespublic SigningPublicKey()
public SigningPublicKey(byte[] data)
public SigningPublicKey(SigType type)
type - if null, type is unknownpublic SigningPublicKey(SigType type, byte[] data)
type - if null, type is unknownpublic SigningPublicKey(String base64Data) throws DataFormatException
base64Data - a string of base64 data (the output of .toBase64() called
on a prior instance of SigningPublicKeyDataFormatExceptionpublic SigningPublicKey blind(SigningPrivateKey alpha)
alpha - the secret dataUnsupportedOperationException - unless supportedpublic static void clearCache()
public static SigningPublicKey create(byte[] data, int off)
DataFormatException - if not enough bytespublic static SigningPublicKey create(InputStream in) throws IOException
IOExceptionpublic boolean equals(Object obj)
SimpleDataStructureequals in class SimpleDataStructurepublic byte[] getPadding(KeyCertificate kcert)
IllegalArgumentException - if this is already typed to a different typepublic SigType getType()
public int hashCode()
SimpleDataStructurehashCode in class SimpleDataStructurepublic int length()
SimpleDataStructurelength in class SimpleDataStructurepublic String toString()
toString in class SimpleDataStructureSigningPublicKey toTypedKey(KeyCertificate kcert)
IllegalArgumentException - if this is already typed to a different typevoid writeTruncatedBytes(OutputStream out) throws DataFormatException, IOException
DataFormatExceptionIOException