Package org.bouncycastle.cert.plants
Class MTCCertAuth
- java.lang.Object
-
- org.bouncycastle.cert.plants.MTCCertAuth
-
public class MTCCertAuth extends java.lang.ObjectIdentity-side helper for an MTC Certification Authority, per Section 5 of draft-ietf-plants-merkle-tree-certs. Bundles the CA's trust anchor ID (in both dotted-decimal and binary forms) along with the log hash and cosigner signature algorithm identifiers, and exposes the per-issuance derivations that depend on this identity:logId(long)— the issuance log's binary trust anchor IDissuerName()— the X.500 Name used in the cert's issuer fieldcertSerial(long, long)— a packed(log_number, index)cert serial#authorityInfo(BigInteger)— theMTCCertificationAuthorityextension value the relying party needs out-of-band
Identity-only: the CA's signing keypair stays separate so the same
MTCCertAuthcan be shared between an issuer (which holds the private key for cosigning) and a relying party (which holds the matching public key for verification).
-
-
Constructor Summary
Constructors Constructor Description MTCCertAuth(byte[] caId, MerkleTreeHash hashFunc, org.bouncycastle.asn1.ASN1ObjectIdentifier sigAlgOid)MTCCertAuth(java.lang.String dottedCaId, MerkleTreeHash hashFunc, org.bouncycastle.asn1.ASN1ObjectIdentifier sigAlgOid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.asn1.x509.MTCCertificationAuthorityauthorityInfo(java.math.BigInteger minSerial, java.math.BigInteger maxSerial)Builds theMTCCertificationAuthorityextension value that the relying party needs to validate certs from this CA.java.math.BigIntegercertSerial(long logNumber, long index)java.math.BigIntegercertSerial(MTCLog log, long index)Equivalent tocertSerial(long, long)with the log number taken fromlog.getLogNumber().byte[]getCaId()java.lang.StringgetDottedCaId()MerkleTreeHashgetHashFunc()org.bouncycastle.asn1.x500.X500NameissuerName()byte[]logId(long logNumber)
-
-
-
Constructor Detail
-
MTCCertAuth
public MTCCertAuth(java.lang.String dottedCaId, MerkleTreeHash hashFunc, org.bouncycastle.asn1.ASN1ObjectIdentifier sigAlgOid)- Parameters:
dottedCaId- dotted-decimal form of the CA's trust anchor ID (e.g."32473.1")hashFunc- hash function used by all issuance logs operated by this CA (Section 5.5) — itsalgorithm identifieris published in the CA'slogHashsigAlgOid- CA cosigner's signature algorithm (Section 5.5)
-
MTCCertAuth
public MTCCertAuth(byte[] caId, MerkleTreeHash hashFunc, org.bouncycastle.asn1.ASN1ObjectIdentifier sigAlgOid)- Parameters:
caId- binary form of the CA's trust anchor IDhashFunc- hash function used by all issuance logs operated by this CA (Section 5.5)sigAlgOid- CA cosigner's signature algorithm (Section 5.5)
-
-
Method Detail
-
getCaId
public byte[] getCaId()
- Returns:
- the CA's binary trust anchor ID (defensive copy).
-
getDottedCaId
public java.lang.String getDottedCaId()
- Returns:
- the CA's trust anchor ID in dotted-decimal form.
-
getHashFunc
public MerkleTreeHash getHashFunc()
- Returns:
- the hash function used by all issuance logs operated by this CA.
-
logId
public byte[] logId(long logNumber)
- Parameters:
logNumber- log number (1 <= logNumber <= 2^16-1, Section 5.2)- Returns:
- the binary trust anchor ID of issuance log
logNumberoperated by this CA
-
issuerName
public org.bouncycastle.asn1.x500.X500Name issuerName()
- Returns:
- the issuer
X500Namefor certs issued by this CA, carrying the trust anchor ID via the experimentalid_rdna_trustAnchorIDattribute
-
certSerial
public java.math.BigInteger certSerial(long logNumber, long index)- Parameters:
logNumber- log number (1 <= logNumber <= 2^16-1)index- entry index in the log (0 <= index <= 2^48-1)- Returns:
- the 64-bit cert serial composed per Section 6.1
-
certSerial
public java.math.BigInteger certSerial(MTCLog log, long index)
Equivalent tocertSerial(long, long)with the log number taken fromlog.getLogNumber().
-
authorityInfo
public org.bouncycastle.asn1.x509.MTCCertificationAuthority authorityInfo(java.math.BigInteger minSerial, java.math.BigInteger maxSerial)Builds theMTCCertificationAuthorityextension value that the relying party needs to validate certs from this CA. Combines the CA's log hash and cosigner signature algorithm with the supplied serial range.- Parameters:
minSerial- minimum allowed cert serial from this CA (Section 5.5 / 6.1)maxSerial- maximum allowed cert serial from this CA (Section 5.5 / 6.1)
-
-