|
||||||||||
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.KeysAndCert
public class KeysAndCert
KeysAndCert has a public key, a signing key, and a certificate. In that order. We also store a cached Hash. Implemented in 0.8.2 and retrofitted over Destination and RouterIdentity. There's actually no difference between the two of them. As of 0.9.9 this data structure is immutable after the two keys and the certificate are set; attempts to change them will throw an IllegalStateException.
Field Summary | |
---|---|
protected Certificate |
_certificate
|
protected byte[] |
_padding
|
protected PublicKey |
_publicKey
|
protected SigningPublicKey |
_signingKey
|
Constructor Summary | |
---|---|
KeysAndCert()
|
Method Summary | |
---|---|
Hash |
calculateHash()
Throws IllegalStateException if keys and cert are not initialized, as of 0.9.12. |
boolean |
equals(Object object)
|
Certificate |
getCertificate()
|
Hash |
getHash()
Throws IllegalStateException if keys and cert are not initialized, as of 0.9.12. |
byte[] |
getPadding()
|
PublicKey |
getPublicKey()
|
SigningPublicKey |
getSigningPublicKey()
|
SigType |
getSigType()
|
int |
hashCode()
the signing key has enough randomness in it to use it by itself for speed |
void |
readBytes(InputStream in)
Load up the current object with data from the given stream. |
void |
setCertificate(Certificate cert)
|
void |
setPadding(byte[] padding)
|
void |
setPublicKey(PublicKey key)
|
void |
setSigningPublicKey(SigningPublicKey key)
|
String |
toString()
|
void |
writeBytes(OutputStream out)
Write out the data structure to the stream, using the format defined in the I2P data structure specification. |
Methods inherited from class net.i2p.data.DataStructureImpl |
---|
fromBase64, fromByteArray, read, toBase64, toByteArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected PublicKey _publicKey
protected SigningPublicKey _signingKey
protected Certificate _certificate
protected byte[] _padding
Constructor Detail |
---|
public KeysAndCert()
Method Detail |
---|
public Certificate getCertificate()
public void setCertificate(Certificate cert)
IllegalStateException
- if was already setpublic SigType getSigType()
public PublicKey getPublicKey()
public void setPublicKey(PublicKey key)
IllegalStateException
- if was already setpublic SigningPublicKey getSigningPublicKey()
public void setSigningPublicKey(SigningPublicKey key)
IllegalStateException
- if was already setpublic byte[] getPadding()
public void setPadding(byte[] padding)
IllegalStateException
- if was already setpublic void readBytes(InputStream in) throws DataFormatException, IOException
DataStructure
in
- stream to read from
IllegalStateException
- if data already set
DataFormatException
- if the data is improperly formatted
IOException
- if there was a problem reading the streampublic void writeBytes(OutputStream out) throws DataFormatException, IOException
DataStructure
out
- stream to write to
DataFormatException
- if the data was incomplete or not yet ready to be written
IOException
- if there was a problem writing to the streampublic boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public Hash calculateHash()
calculateHash
in interface DataStructure
calculateHash
in class DataStructureImpl
IllegalStateException
public Hash getHash()
IllegalStateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |