|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.data.DataStructureImpl
net.i2p.data.SimpleDataStructure
net.i2p.data.Signature
public class Signature
Defines the signature as defined by the I2P data structure spec. By default, a signature is a 40-byte array verifying the authenticity of some data using the DSA-SHA1 algorithm. The signature is the 20-byte R followed by the 20-byte S, both are unsigned integers. As of release 0.9.8, signatures of arbitrary length and type are supported. See SigType.
Field Summary | |
---|---|
static byte[] |
FAKE_SIGNATURE
Deprecated. to be removed |
static int |
SIGNATURE_BYTES
40 |
Fields inherited from class net.i2p.data.SimpleDataStructure |
---|
_data |
Constructor Summary | |
---|---|
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? |
Method Summary | |
---|---|
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()
|
Methods inherited from class net.i2p.data.SimpleDataStructure |
---|
calculateHash, fromBase64, fromByteArray, getData, readBytes, setData, toBase64, toByteArray, writeBytes |
Methods inherited from class net.i2p.data.DataStructureImpl |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SIGNATURE_BYTES
public static final byte[] FAKE_SIGNATURE
Constructor Detail |
---|
public Signature()
public Signature(SigType type)
type
- non-nullpublic Signature(byte[] data)
public Signature(SigType type, byte[] data)
type
- non-nullMethod Detail |
---|
public int length()
SimpleDataStructure
length
in class SimpleDataStructure
public SigType getType()
public String toString()
toString
in class SimpleDataStructure
public int hashCode()
SimpleDataStructure
hashCode
in class SimpleDataStructure
public boolean equals(Object obj)
SimpleDataStructure
equals
in class SimpleDataStructure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |