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_BYTESDefault signature length in bytes. |
_data| Constructor and Description |
|---|
Signature()Creates a new Signature with the default DSA-SHA1 type. |
Signature(byte[] data)Creates a new Signature from byte data with default type. |
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)Compares this signature with another object for equality. |
SigType | getType()Gets the signature type. |
int | hashCode()Hash code combining the type and data. |
int | length()Signature length in bytes, determined by the signature type. |
String | toString()Returns a string representation of this data structure. |
calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytespublic static final int SIGNATURE_BYTES
public Signature()
public Signature(byte[] data)
public Signature(SigType type)
type - non-nullpublic Signature(SigType type, byte[] data)
type - non-nulldata - the signature datapublic boolean equals(Object obj)
equals in class SimpleDataStructureobj - the object to comparepublic SigType getType()
public int hashCode()
hashCode in class SimpleDataStructurepublic int length()
length in class SimpleDataStructurepublic String toString()
SimpleDataStructuretoString in class SimpleDataStructure