net.i2p.data
public class KeysAndCert extends DataStructureImpl
Modifier and Type | Field and Description |
---|---|
protected Hash |
__calculatedHash |
protected Certificate |
_certificate |
protected PublicKey |
_publicKey |
protected SigningPublicKey |
_signingKey |
Constructor and Description |
---|
KeysAndCert() |
Modifier and Type | Method and Description |
---|---|
Hash |
calculateHash()
Calculate the SHA256 value of this object (useful for a few scenarios)
|
boolean |
equals(Object object) |
Certificate |
getCertificate() |
Hash |
getHash() |
PublicKey |
getPublicKey() |
SigningPublicKey |
getSigningPublicKey() |
int |
hashCode()
the public 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 |
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.
|
fromBase64, fromByteArray, read, toBase64, toByteArray
protected PublicKey _publicKey
protected SigningPublicKey _signingKey
protected Certificate _certificate
protected Hash __calculatedHash
public Certificate getCertificate()
public void setCertificate(Certificate cert)
public PublicKey getPublicKey()
public void setPublicKey(PublicKey key)
public SigningPublicKey getSigningPublicKey()
public void setSigningPublicKey(SigningPublicKey key)
public void readBytes(InputStream in) throws DataFormatException, IOException
DataStructure
in
- stream to read fromDataFormatException
- if the data is improperly formattedIOException
- if there was a problem reading the streampublic void writeBytes(OutputStream out) throws DataFormatException, IOException
DataStructure
out
- stream to write toDataFormatException
- if the data was incomplete or not yet ready to be writtenIOException
- if there was a problem writing to the streampublic int hashCode()
public Hash calculateHash()
DataStructure
calculateHash
in interface DataStructure
calculateHash
in class DataStructureImpl
public Hash getHash()