public class VerifiedDestination extends Destination
Modifier and Type | Field and Description |
---|---|
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
|
_certificate, _padding, _publicKey, _signingKey
Constructor and Description |
---|
VerifiedDestination() |
VerifiedDestination(Destination d)
create from an existing Dest
|
VerifiedDestination(String s)
alternative constructor which takes a base64 string representation
|
Modifier and Type | Method and Description |
---|---|
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
|
clearCache, create, equals, hashCode, readBytes, size, toBase32, toBase64, writeBytes
calculateHash, getCertificate, getHash, getPadding, getPublicKey, getSigningPublicKey, getSigType, readBytes, setCertificate, setPadding, setPublicKey, setSigningPublicKey, writeBytes
fromBase64, fromByteArray, read, toByteArray
public static final int MIN_HASHCASH_EFFORT
public static final int CERTIFICATE_LENGTH_SIGNED
public static final int CERTIFICATE_LENGTH_SIGNED_WITH_HASH
public VerifiedDestination()
public VerifiedDestination(String s) throws DataFormatException
s
- a Base64 representation of the destination, as (eg) is used in hosts.txtDataFormatException
public VerifiedDestination(Destination d) throws DataFormatException
d
- must be non-nullDataFormatException
public boolean verifyCert(boolean allowNone)
allowNone
- If true, allow a NULL or HIDDEN certificate.protected boolean verifyHashCashCert()
protected boolean verifySignedCert()
protected boolean verifyUnknownCert()
public String toString()
toString
in class KeysAndCert