|
||||||||||
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.Destination
net.i2p.data.VerifiedDestination
public class VerifiedDestination
Extend Destination with methods to verify its Certificate. The router does not check Certificates, it doesn't care. Apps however (particularly addressbook) may wish to enforce various cert content, format, and policies. This class is written such that apps may extend it to create their own policies.
Field Summary | |
---|---|
static int |
CERTIFICATE_LENGTH_SIGNED
Defaults for Signed Certs |
static int |
CERTIFICATE_LENGTH_SIGNED_WITH_HASH
|
static int |
MIN_HASHCASH_EFFORT
Defaults for HashCash Certs |
Fields inherited from class net.i2p.data.Destination |
---|
__calculatedHash, _certificate, _publicKey, _signingKey |
Constructor Summary | |
---|---|
VerifiedDestination()
|
|
VerifiedDestination(Destination d)
create from an existing Dest |
|
VerifiedDestination(java.lang.String s)
alternative constructor which takes a base64 string representation |
Method Summary | |
---|---|
java.lang.String |
toString()
|
boolean |
verifyCert(boolean allowNone)
verify the certificate. |
protected boolean |
verifyHashCashCert()
HashCash Certs are used to demonstrate proof-of-work. |
protected boolean |
verifySignedCert()
Signed Certs are signed by a 3rd-party Destination. |
protected boolean |
verifyUnknownCert()
Reject all unknown certs |
Methods inherited from class net.i2p.data.Destination |
---|
calculateHash, equals, getCertificate, getPublicKey, getSigningPublicKey, hashCode, main, readBytes, readBytes, setCertificate, setPublicKey, setSigningPublicKey, size, writeBytes, writeBytes |
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 |
---|
public static final int MIN_HASHCASH_EFFORT
public static final int CERTIFICATE_LENGTH_SIGNED
public static final int CERTIFICATE_LENGTH_SIGNED_WITH_HASH
Constructor Detail |
---|
public VerifiedDestination()
public VerifiedDestination(java.lang.String s) throws DataFormatException
s
- a Base64 representation of the destination, as (eg) is used in hosts.txt
DataFormatException
public VerifiedDestination(Destination d) throws DataFormatException
d
- must be non-null
DataFormatException
Method Detail |
---|
public boolean verifyCert(boolean allowNone)
allowNone
- If true, allow a NULL or HIDDEN certificate.protected boolean verifyHashCashCert()
protected boolean verifySignedCert()
protected boolean verifyUnknownCert()
public java.lang.String toString()
toString
in class Destination
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |