Package org.bouncycastle.cert.plants
Class LandmarkCertificateManager
- java.lang.Object
-
- org.bouncycastle.cert.plants.LandmarkCertificateManager
-
public class LandmarkCertificateManager extends java.lang.ObjectIssuance- 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, org.bouncycastle.asn1.x509.TBSCertificateLogEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.cert.plants.MerkleTreePrimitives.SubtreeInfo, java.util.List<byte[]>, org.bouncycastle.cert.plants.MerkleTreeHash)produces a landmark-relative certificate (an X.509 wrapper around anMTCProofwhose inclusion proof targets a predistributed landmark subtree). The nestedLandmarkCertificateManager.TrustedSubtreeManagermaintains a relying party's set oftrusted landmarks, accepting a new landmark once it has been related to a sufficiently-cosigned reference checkpoint via a subtree consistency proof.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLandmarkCertificateManager.TrustedSubtreeEntryA trusted subtree along with the reference checkpoint that proved its consistency, per Section 7.4.static classLandmarkCertificateManager.TrustedSubtreeManagerMaintains 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 Summary
Constructors Constructor Description LandmarkCertificateManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static X509CertificateHolderbuildLandmarkCertificate(long logNumber, long index, org.bouncycastle.asn1.x509.TBSCertificateLogEntry tbsCertEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo landmarkSubtree, java.util.List<byte[]> inclusionProof, MerkleTreeHash hashFunc)Builds a landmark-relative certificate (no signatures, only an inclusion proof to a predistributed landmark subtree, Section 6.3.4).static X509CertificateHolderbuildLandmarkCertificate(MTCLog log, long index, org.bouncycastle.asn1.x509.TBSCertificateLogEntry tbsCertEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo, java.util.List<byte[]> inclusionProof)Convenience overload ofbuildLandmarkCertificate(long, long, TBSCertificateLogEntry, SubjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo, List, MerkleTreeHash)taking the log number, landmark subtree window and hash function from anMTCLogwhose[start, end)is the landmark subtree.
-
-
-
Method Detail
-
buildLandmarkCertificate
public static X509CertificateHolder buildLandmarkCertificate(long logNumber, long index, org.bouncycastle.asn1.x509.TBSCertificateLogEntry tbsCertEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo landmarkSubtree, java.util.List<byte[]> inclusionProof, MerkleTreeHash hashFunc) throws java.io.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 entrysubjectPublicKeyInfo- the actual subject public key (its hash must match tbsCertEntry.subjectPublicKeyInfoHash)landmarkSubtree- the landmark subtree containing the entryinclusionProof- inclusion proof hashes from the entry to landmarkSubtreehashFunc- the log's hash function- Returns:
- the landmark-relative certificate
- Throws:
java.io.IOException
-
buildLandmarkCertificate
public static X509CertificateHolder buildLandmarkCertificate(MTCLog log, long index, org.bouncycastle.asn1.x509.TBSCertificateLogEntry tbsCertEntry, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo, java.util.List<byte[]> inclusionProof) throws java.io.IOException
Convenience overload ofbuildLandmarkCertificate(long, long, TBSCertificateLogEntry, SubjectPublicKeyInfo, MerkleTreePrimitives.SubtreeInfo, List, MerkleTreeHash)taking the log number, landmark subtree window and hash function from anMTCLogwhose[start, end)is the landmark subtree.- Throws:
java.io.IOException
-
-