Class LandmarkCertificateManager

java.lang.Object
org.bouncycastle.cert.plants.LandmarkCertificateManager

public class LandmarkCertificateManager extends Object
Issuance- and relying-party-side helpers for landmark subtrees, per Sections 6.3 and 7.4 of draft-ietf-plants-merkle-tree-certs.

buildLandmarkCertificate(long, long, TBSCertificateLogEntry, SubjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo, List, MerkleTreeHash) produces a landmark-relative certificate (an X.509 wrapper around an MTCProof whose inclusion proof targets a predistributed landmark subtree). The nested LandmarkCertificateManager.TrustedSubtreeManager maintains a relying party's set of trusted landmarks, accepting a new landmark once it has been related to a sufficiently-cosigned reference checkpoint via a subtree consistency proof.

  • Constructor Details

    • LandmarkCertificateManager

      public LandmarkCertificateManager()
  • Method Details

    • buildLandmarkCertificate

      public static X509CertificateHolder buildLandmarkCertificate(long logNumber, long index, org.bouncycastle.asn1.x509.TBSCertificateLogEntry tbsCertEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo landmarkSubtree, List<byte[]> inclusionProof, MerkleTreeHash hashFunc) throws IOException
      Builds a landmark-relative certificate (no signatures, only an inclusion proof to a predistributed landmark subtree, Section 6.3.4). The certificate serial number is packed from the log number and the entry's index per Section 6.1: serial = (log_number << 48) | index.
      Parameters:
      logNumber - number of the issuance log containing the entry (1 <= logNumber <= 2^16-1)
      index - the entry's index in the log (0 <= index <= 2^48-1)
      tbsCertEntry - the TBSCertificateLogEntry describing the entry
      subjectPublicKeyInfo - the actual subject public key (its hash must match tbsCertEntry.subjectPublicKeyInfoHash)
      landmarkSubtree - the landmark subtree containing the entry
      inclusionProof - inclusion proof hashes from the entry to landmarkSubtree
      hashFunc - the log's hash function
      Returns:
      the landmark-relative certificate
      Throws:
      IOException
    • buildLandmarkCertificate

      public static X509CertificateHolder buildLandmarkCertificate(MTCLog log, long index, org.bouncycastle.asn1.x509.TBSCertificateLogEntry tbsCertEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo, List<byte[]> inclusionProof) throws IOException
      Convenience overload of buildLandmarkCertificate(long, long, TBSCertificateLogEntry, SubjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo, List, MerkleTreeHash) taking the log number, landmark subtree window and hash function from an MTCLog whose [start, end) is the landmark subtree.
      Throws:
      IOException