public class PublicKey extends SimpleDataStructure
Modifier and Type | Field and Description |
---|---|
static int |
KEYSIZE_BYTES |
_data
Constructor and Description |
---|
PublicKey() |
PublicKey(byte[] data) |
PublicKey(EncType type) |
PublicKey(EncType type,
byte[] data) |
PublicKey(int typeCode,
byte[] data)
Unknown type only.
|
PublicKey(String base64Data)
Constructs from base64.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearCache() |
static PublicKey |
create(byte[] data,
int off)
Pull from cache or return new.
|
static PublicKey |
create(InputStream in)
Pull from cache or return new
|
EncType |
getType() |
int |
getUnknownTypeCode()
Only valid if getType() returns null
|
int |
length()
The legal length of the byte array in this data structure
|
String |
toString() |
calculateHash, equals, fromBase64, fromByteArray, getData, hashCode, readBytes, setData, toBase64, toByteArray, writeBytes
read
public PublicKey()
public PublicKey(EncType type)
type
- if null, type is unknownpublic PublicKey(byte[] data)
data
- must be non-nullpublic PublicKey(EncType type, byte[] data)
type
- if null, type is unknowndata
- must be non-nullpublic PublicKey(int typeCode, byte[] data)
typeCode
- must not match a known type. 1-255data
- must be non-nullpublic PublicKey(String base64Data) throws DataFormatException
base64Data
- a string of base64 data (the output of .toBase64() called
on a prior instance of PublicKeyDataFormatException
public static PublicKey create(byte[] data, int off)
ArrayIndexOutOfBoundsException
- if not enough bytes, FIXME should throw DataFormatExceptionpublic static PublicKey create(InputStream in) throws IOException
IOException
public int length()
SimpleDataStructure
length
in class SimpleDataStructure
public EncType getType()
public int getUnknownTypeCode()
public static void clearCache()
public String toString()
toString
in class SimpleDataStructure