Class BcMTCCosignerVerifierProvider

java.lang.Object
org.bouncycastle.cert.plants.bc.BcMTCCosignerVerifierProvider
All Implemented Interfaces:
MTCCosignerVerifierProvider

public class BcMTCCosignerVerifierProvider extends Object implements MTCCosignerVerifierProvider
Lightweight-side MTCCosignerVerifierProvider that holds a table of cosigner trust anchor IDs mapped to MTCSignatureVerifier instances.

The convenience BcMTCCosignerVerifierProvider.Builder.addCosigner(byte[], AsymmetricKeyParameter) overload wraps a lightweight AsymmetricKeyParameter in a BcMTCSignatureVerifier, auto-detecting the draft algorithm identifier from the key type:

  • ECPublicKeyParameters with a 256-bit field → ECDSA-P256-SHA256
  • ECPublicKeyParameters with a 384-bit field → ECDSA-P384-SHA384
  • Ed25519PublicKeyParametersEd25519
  • MLDSAPublicKeyParametersML-DSA-44 / ML-DSA-65 / ML-DSA-87 per the key's parameter set

Callers needing a different algorithm string for the same key type, or a key flavour from another module (e.g. a JCA java.security.PublicKey wrapped in org.bouncycastle.cert.plants.jcajce.JcaMTCSignatureVerifier), can use BcMTCCosignerVerifierProvider.Builder.addCosigner(byte[], MTCSignatureVerifier) directly.

  • Method Details

    • singleCosigner

      public static BcMTCCosignerVerifierProvider singleCosigner(byte[] cosignerId, MTCSignatureVerifier verifier)
      Convenience factory for the single-cosigner case — wraps Builder().addCosigner(cosignerId, verifier).build(). Suitable when the relying party trusts exactly one cosigner (e.g. the CA itself, per Section 5.3 of draft-ietf-plants-merkle-tree-certs).
    • singleCosigner

      public static BcMTCCosignerVerifierProvider singleCosigner(byte[] cosignerId, org.bouncycastle.crypto.params.AsymmetricKeyParameter publicKey)
      Convenience factory for the single-cosigner case taking a lightweight public key; the draft algorithm identifier is detected from the key type.
      Throws:
      IllegalArgumentException - if the public key type is unsupported
    • get

      public MTCCosignerVerifier get(byte[] cosignerId)
      Specified by:
      get in interface MTCCosignerVerifierProvider
      Parameters:
      cosignerId - the binary trust anchor ID of the cosigner
      Returns:
      a verifier for the cosigner, or null if the cosigner is unknown