Class CosignerRequirement

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

public final class CosignerRequirement extends Object
A relying party's cosigner policy, as the "Trusted Cosigners" section of draft-ietf-plants-merkle-tree-certs (Section 7.3) describes it: which combinations of cosigners must have cosigned a subtree before a certificate in it is accepted.

A requirement is a tree. The leaves name a cosigner, either by its cosigner ID (cosigner(byte[])) or as the CA that issued the certificate under validation (issuingCA(), whose cosigner ID is the CA ID in the certificate's issuer). The interior nodes are quorums over their members (atLeast(int, CosignerRequirement[]), with anyOf(CosignerRequirement[]) and allOf(CosignerRequirement[]) as the two common thresholds), so a policy such as "the CA and at least two independent operators" is

CosignerRequirement.allOf(
    CosignerRequirement.issuingCA(),
    CosignerRequirement.atLeast(2,
        CosignerRequirement.anyOf(operatorA1, operatorA2),
        CosignerRequirement.anyOf(operatorB1),
        CosignerRequirement.anyOf(operatorC1, operatorC2)))

Section 7.3 recommends that a relying party require the CA cosigner, for authenticity, together with a quorum of additional cosigners, for transparency. MerkleTreeCertificateValidator evaluates the requirements in MerkleTreeCertificateValidator.ValidationParams against the cosignatures that verified under the registered MTCCosignerVerifierProvider; a cosigner that is not registered never satisfies a leaf. A certificate whose subtree matches a trusted subtree (Section 7.4) is accepted without reference to the requirements, since a trusted subtree is one already known to satisfy them.

Instances are immutable.

  • Method Details

    • cosigner

      public static CosignerRequirement cosigner(byte[] cosignerId)
      A requirement satisfied by a valid cosignature from the cosigner with the given binary cosigner ID (see TrustAnchorIDs).
    • issuingCA

      public static CosignerRequirement issuingCA()
      A requirement satisfied by a valid cosignature from the CA that issued the certificate being validated: the cosigner whose ID equals the CA ID carried in the certificate's issuer name. Section 7.3 recommends every policy include this.
    • atLeast

      public static CosignerRequirement atLeast(int threshold, CosignerRequirement... members)
      A requirement satisfied when at least threshold of the member requirements are satisfied.
      Parameters:
      threshold - the number of members that must be satisfied, from 1 to the number of members
      members - the member requirements, at least one
    • anyOf

      public static CosignerRequirement anyOf(CosignerRequirement... members)
      A requirement satisfied when any one of the member requirements is.
    • allOf

      public static CosignerRequirement allOf(CosignerRequirement... members)
      A requirement satisfied only when every member requirement is.
    • isSatisfiedBy

      public boolean isSatisfiedBy(Collection<byte[]> verifiedCosignerIds, byte[] caId)
      Evaluates this requirement against the cosigners whose cosignatures verified.
      Parameters:
      verifiedCosignerIds - the binary cosigner IDs whose cosignatures over the subtree verified
      caId - the binary CA ID of the certificate's issuer, which issuingCA() leaves match, or null if unknown
      Returns:
      true if the requirement is satisfied
    • getCosignerId

      public byte[] getCosignerId()
      The cosigner ID a cosigner(byte[]) leaf names, or null for any other node.
    • isIssuingCA

      public boolean isIssuingCA()
      True for the issuingCA() leaf.
    • getThreshold

      public int getThreshold()
      The number of members a quorum node needs satisfied, or 0 for a leaf.
    • getMembers

      public List<CosignerRequirement> getMembers()
      The members of a quorum node, or an empty list for a leaf.
    • toString

      public String toString()
      A readable form, with cosigner IDs in dotted decimal: CA, 32473.2.1, atLeast(2: 32473.2.1, 32473.2.2, 32473.2.3).
      Overrides:
      toString in class Object