public class Proof extends Object
| Constructor and Description |
|---|
Proof(ByzCoinProto.Proof p,
SkipblockId scID,
InstanceId iid)
Creates a new proof given a protobuf-representation and a trusted skipchain ID.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contractIsType(String expectedType)
Checks whether the contract ID matches the expected ID.
|
boolean |
exists(byte[] key)
Check whether the key exists in the proof.
|
String |
getContractID() |
DarcId |
getDarcBaseID() |
Instance |
getInstance()
Creates an instance from the proof, it assumes the proof is valid.
|
byte[] |
getKey() |
SkipBlock |
getLatest()
Getter for the skipblock associated with this proof.
|
byte[] |
getRoot()
Getter for the Merkle-root, returns null if it doesn't exist.
|
byte[] |
getValue() |
StateChangeBody |
getValues() |
boolean |
matches()
Check whether the key (Instance ID) exists.
|
ByzCoinProto.Proof |
toProto()
Get the protobuf representation of the proof.
|
public Proof(ByzCoinProto.Proof p, SkipblockId scID, InstanceId iid) throws CothorityCryptoException
p - is the protobuf representationscID - is the skipchain IDCothorityCryptoException - if the verification of the forward links are wrongpublic Instance getInstance()
public ByzCoinProto.Proof toProto()
public SkipBlock getLatest()
public byte[] getRoot()
public byte[] getKey()
public StateChangeBody getValues()
public byte[] getValue()
public String getContractID()
public DarcId getDarcBaseID()
public boolean contractIsType(String expectedType)
expectedType - the expected contractIdpublic boolean matches()
public boolean exists(byte[] key)
throws CothorityCryptoException
key - is the value that we want to proof whether it exists or is absent.CothorityCryptoException - if an unexpected error occurs, an absence proof does not throw an exception.Copyright © 2019. All rights reserved.