public class Signature extends SimpleDataStructure
Signature provides digital signature capabilities with support for multiple algorithms:
Signature Structure:
Supported Algorithms:
Usage:
DestinationSecurity Considerations:
Evolution:
SigType| Modifier and Type | Field and Description |
|---|---|
static int |
SIGNATURE_BYTES
40
|
_data| Constructor and Description |
|---|
Signature() |
Signature(byte[] data) |
Signature(SigType type)
Unknown type not allowed as we won't know the length to read in the data.
|
Signature(SigType type,
byte[] data)
Should we allow an unknown type here?
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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() |
calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytespublic Signature()
public Signature(byte[] data)
public Signature(SigType type)
type - non-nullpublic Signature(SigType type, byte[] data)
type - non-nullpublic boolean equals(Object obj)
SimpleDataStructureequals in class SimpleDataStructurepublic SigType getType()
public int hashCode()
SimpleDataStructurehashCode in class SimpleDataStructurepublic int length()
SimpleDataStructurelength in class SimpleDataStructurepublic String toString()
toString in class SimpleDataStructure