public class SigningPublicKey extends SimpleDataStructure
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() |
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() |
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() |
SigningPublicKey |
toTypedKey(KeyCertificate kcert)
Up-convert this from an untyped (type 0) SPK to a typed SPK based on the Key Cert given.
|
void |
writeTruncatedBytes(OutputStream out)
Write the data up to a max of 128 bytes.
|
calculateHash, fromBase64, fromByteArray, getData, readBytes, setData, toBase64, toByteArray, writeBytes
read
public SigningPublicKey()
public SigningPublicKey(SigType type)
type
- if null, type is unknownpublic SigningPublicKey(byte[] data)
public 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 SigningPublicKeyDataFormatException
public static SigningPublicKey create(byte[] data, int off)
ArrayIndexOutOfBoundsException
- if not enough bytes, FIXME should throw DataFormatExceptionpublic static SigningPublicKey create(InputStream in) throws IOException
IOException
public int length()
SimpleDataStructure
length
in class SimpleDataStructure
public SigType getType()
public SigningPublicKey toTypedKey(KeyCertificate kcert)
IllegalArgumentException
- if this is already typed to a different typepublic byte[] getPadding(KeyCertificate kcert)
IllegalArgumentException
- if this is already typed to a different typepublic void writeTruncatedBytes(OutputStream out) throws DataFormatException, IOException
DataFormatException
IOException
public SigningPublicKey blind(SigningPrivateKey alpha)
alpha
- the secret dataUnsupportedOperationException
- unless supportedpublic String toString()
toString
in class SimpleDataStructure
public static void clearCache()
public int hashCode()
SimpleDataStructure
hashCode
in class SimpleDataStructure
public boolean equals(Object obj)
SimpleDataStructure
equals
in class SimpleDataStructure