Class LandmarkCertificateManager.TrustedSubtreeManager
java.lang.Object
org.bouncycastle.cert.plants.LandmarkCertificateManager.TrustedSubtreeManager
- Enclosing class:
LandmarkCertificateManager
Maintains a relying-party-side list of trusted subtrees by accepting new
landmarks that come with a cosigned reference checkpoint and a subtree
consistency proof.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA snapshot of the log: tree size and root hash. -
Constructor Summary
ConstructorsConstructorDescriptionTrustedSubtreeManager(byte[] logId, MerkleTreeHash hashFunc, MTCCosignerVerifierProvider cosignerVerifierProvider, int minCosignaturesForCheckpoint) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddLandmarkSubtree(long subtreeStart, long subtreeEnd, byte[] subtreeHash, LandmarkCertificateManager.TrustedSubtreeManager.Checkpoint referenceCheckpoint, List<byte[]> consistencyProof, List<MTCSignature> checkpointSignatures) Attempts to add a new landmark subtree.
-
Constructor Details
-
TrustedSubtreeManager
public TrustedSubtreeManager(byte[] logId, MerkleTreeHash hashFunc, MTCCosignerVerifierProvider cosignerVerifierProvider, int minCosignaturesForCheckpoint) - Parameters:
logId- binary trust anchor ID of the loghashFunc- hash function used by the logcosignerVerifierProvider- provider that hands back a verifier per known cosigner IDminCosignaturesForCheckpoint- minimum valid cosignatures required to trust a checkpoint
-
-
Method Details
-
getTrustedSubtrees
-
addLandmarkSubtree
public boolean addLandmarkSubtree(long subtreeStart, long subtreeEnd, byte[] subtreeHash, LandmarkCertificateManager.TrustedSubtreeManager.Checkpoint referenceCheckpoint, List<byte[]> consistencyProof, List<MTCSignature> checkpointSignatures) throws IOException Attempts to add a new landmark subtree. The subtree is accepted if:- The reference checkpoint carries enough valid cosignatures, and
- The supplied subtree consistency proof relates the subtree to that checkpoint.
- Returns:
trueif the landmark was added- Throws:
IOException
-