Class LandmarkCertificateManager.TrustedSubtreeManager

  • Enclosing class:
    LandmarkCertificateManager

    public static class LandmarkCertificateManager.TrustedSubtreeManager
    extends java.lang.Object
    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.
    • Constructor Detail

      • TrustedSubtreeManager

        public TrustedSubtreeManager​(byte[] logId,
                                     MerkleTreeHash hashFunc,
                                     MTCCosignerVerifierProvider cosignerVerifierProvider,
                                     int minCosignaturesForCheckpoint)
        Parameters:
        logId - binary trust anchor ID of the log
        hashFunc - hash function used by the log
        cosignerVerifierProvider - provider that hands back a verifier per known cosigner ID
        minCosignaturesForCheckpoint - minimum valid cosignatures required to trust a checkpoint
    • Method Detail

      • addLandmarkSubtree

        public boolean addLandmarkSubtree​(long subtreeStart,
                                          long subtreeEnd,
                                          byte[] subtreeHash,
                                          LandmarkCertificateManager.TrustedSubtreeManager.Checkpoint referenceCheckpoint,
                                          java.util.List<byte[]> consistencyProof,
                                          java.util.List<MTCSignature> checkpointSignatures)
                                   throws java.io.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:
        true if the landmark was added
        Throws:
        java.io.IOException