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_BYTESDefault key size in bytes (128 for DSA-SHA1). |
_data| Constructor and Description |
|---|
SigningPublicKey()Creates a new SigningPublicKey with the default DSA-SHA1 type. |
SigningPublicKey(byte[] data)Creates a new SigningPublicKey from byte data with default type. |
SigningPublicKey(SigType type)If null, type is unknown. |
SigningPublicKey(SigType type,
byte[] data)If null, type is unknown. |
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()Hash code combining the type and data. |
int | length()If type unknown, the length of the data, or 128 if no data. |
String | toString()Returns a string representation of this data structure. |
(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 static final int KEYSIZE_BYTES
public 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 unknowndata - the key datapublic 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)
public static SigningPublicKey create(InputStream in) throws IOException
IOExceptionpublic boolean equals(Object obj)
SimpleDataStructureequals in class SimpleDataStructureobj - the object to comparepublic byte[] getPadding(KeyCertificate kcert)
IllegalArgumentException - if this is already typed to a different typepublic SigType getType()
public int hashCode()
hashCode in class SimpleDataStructurepublic int length()
length in class SimpleDataStructurepublic String toString()
SimpleDataStructuretoString in class SimpleDataStructureSigningPublicKey toTypedKey(KeyCertificate kcert)
kcert - the key certificateIllegalArgumentException - if this is already typed to a different typevoid writeTruncatedBytes(OutputStream out) throws DataFormatException, IOException