public final class MTCCertificationAuthorityCertificate
extends java.lang.Object
A Merkle Tree CA is represented as an X.509 certificate whose:
subject is the CA ID encoded as a single-RDN distinguished name,
using MTCObjectIdentifiers.id_rdna_trustAnchorID with a
RELATIVE-OID value carrying the trust anchor IDsubjectPublicKeyInfo is the CA cosigner's public keyextensions carries a critical
MTCObjectIdentifiers.id_pe_mtcCertificationAuthority_SHA256
extension whose value is the MTCCertificationAuthority structure;
the extension type identifies the log hash function, SHA-256 herekeyUsage (critical) asserts at least keyCertSignbasicConstraints (critical) sets cA=truesubjectKeyIdentifier (when present) SHOULD be the binary CA IDPer Section 5.5 such certificates SHOULD NOT be self-signed; they are
typically distributed as unsigned trust anchors. This helper does not sign
the certificate — the caller supplies a ContentSigner
to X509v3CertificateBuilder.build(org.bouncycastle.operator.ContentSigner) when finishing the chain (e.g. an
unsigned-cert signer per draft-ietf-lamps-x509-alg-none, or an external CA).
| Modifier and Type | Field and Description |
|---|---|
static org.bouncycastle.asn1.ASN1ObjectIdentifier |
EXTENSION_OID
OID for the
id-pe-mtcCertificationAuthority-SHA256 certificate extension. |
| Modifier and Type | Method and Description |
|---|---|
static org.bouncycastle.asn1.x509.Extension |
buildAuthorityExtension(org.bouncycastle.asn1.x509.MTCCertificationAuthority info)
Builds the critical
id-pe-mtcCertificationAuthority-SHA256 extension. |
static org.bouncycastle.asn1.x509.MTCCertificationAuthority |
extractAuthorityInfo(X509CertificateHolder cert)
Extracts the
MTCCertificationAuthority structure from the
id-pe-mtcCertificationAuthority-SHA256 extension of a CA certificate. |
static byte[] |
extractCaId(X509CertificateHolder cert)
Extracts the binary CA trust anchor ID from the
subject field of
a CA certificate. |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
logHashAlgorithm(X509CertificateHolder cert)
Returns the hash function the CA's issuance logs use, as identified by the
type of the Merkle Tree CA extension (Section 7.1): SHA-256 for
id-pe-mtcCertificationAuthority-SHA256, the one type the draft
defines. |
static X509v3CertificateBuilder |
newBuilder(org.bouncycastle.asn1.x500.X500Name issuer,
java.math.BigInteger serial,
java.util.Date notBefore,
java.util.Date notAfter,
byte[] caId,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo cosignerSpki,
org.bouncycastle.asn1.x509.MTCCertificationAuthority info)
Prepares a fully-populated
X509v3CertificateBuilder for an MTC CA
certificate. |
static org.bouncycastle.asn1.x500.X500Name |
subjectName(byte[] caId)
Builds the
subject (or issuer) distinguished name for a
CA whose binary trust anchor ID is caId: a single RDN whose
id-rdna-trustAnchorID attribute carries the ID as a RELATIVE-OID
(Section 5.1, and Section 4.1 of draft-ietf-tls-trust-anchor-ids). |
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier EXTENSION_OID
id-pe-mtcCertificationAuthority-SHA256 certificate extension.public static org.bouncycastle.asn1.x500.X500Name subjectName(byte[] caId)
subject (or issuer) distinguished name for a
CA whose binary trust anchor ID is caId: a single RDN whose
id-rdna-trustAnchorID attribute carries the ID as a RELATIVE-OID
(Section 5.1, and Section 4.1 of draft-ietf-tls-trust-anchor-ids).public static org.bouncycastle.asn1.x509.Extension buildAuthorityExtension(org.bouncycastle.asn1.x509.MTCCertificationAuthority info)
throws java.io.IOException
id-pe-mtcCertificationAuthority-SHA256 extension.java.io.IOExceptionpublic static X509v3CertificateBuilder newBuilder(org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serial, java.util.Date notBefore, java.util.Date notAfter, byte[] caId, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo cosignerSpki, org.bouncycastle.asn1.x509.MTCCertificationAuthority info) throws java.io.IOException
X509v3CertificateBuilder for an MTC CA
certificate. The caller must invoke
build
with an appropriate signer (e.g. an unsigned-cert signer, or an external
CA signer).issuer - the X.509 issuer (often the same as subject
when the trust anchor is self-attested, or the OID
of the chaining CA)serial - certificate serial numbernotBefore - validity startnotAfter - validity endcaId - binary CA trust anchor IDcosignerSpki - the cosigner's SubjectPublicKeyInfoinfo - the MTCCertificationAuthority extension valuejava.io.IOExceptionpublic static byte[] extractCaId(X509CertificateHolder cert) throws java.io.IOException
subject field of
a CA certificate. The encoding rules mirror
MerkleTreeCertificateValidator.extractCaIdFromIssuer(org.bouncycastle.asn1.x500.X500Name), which reads
the equivalent attribute from the issuer field of a Merkle Tree
end-entity certificate.java.io.IOExceptionpublic static org.bouncycastle.asn1.x509.AlgorithmIdentifier logHashAlgorithm(X509CertificateHolder cert) throws java.io.IOException
id-pe-mtcCertificationAuthority-SHA256, the one type the draft
defines.java.io.IOException - if the extension is absent or not marked criticalpublic static org.bouncycastle.asn1.x509.MTCCertificationAuthority extractAuthorityInfo(X509CertificateHolder cert) throws java.io.IOException
MTCCertificationAuthority structure from the
id-pe-mtcCertificationAuthority-SHA256 extension of a CA certificate.java.io.IOException - if the extension is absent, not marked critical, or
cannot be parsed