public class Signature extends SimpleDataStructure
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
FAKE_SIGNATURE
Deprecated.
to be removed
|
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() |
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, readBytes, setData, toBase64, toByteArray, writeBytesreadpublic static final int SIGNATURE_BYTES
@Deprecated public static final byte[] FAKE_SIGNATURE
public Signature()
public Signature(SigType type)
type - non-nullpublic Signature(byte[] data)
public Signature(SigType type, byte[] data)
type - non-nullpublic int length()
SimpleDataStructurelength in class SimpleDataStructurepublic SigType getType()
public String toString()
toString in class SimpleDataStructurepublic int hashCode()
SimpleDataStructurehashCode in class SimpleDataStructurepublic boolean equals(Object obj)
SimpleDataStructureequals in class SimpleDataStructure