Class JcaMTCCosigner.Builder

java.lang.Object
org.bouncycastle.cert.plants.jcajce.JcaMTCCosigner.Builder
Enclosing class:
JcaMTCCosigner

public static class JcaMTCCosigner.Builder extends Object
Builder for JcaMTCCosigner. Selects the JCA provider used to obtain the underlying Signature instance; the draft algorithm identifier is detected from the private key type at build(byte[], PrivateKey) time.
  • ECPrivateKey with a 256-bit order → ECDSA-P256-SHA256
  • ECPrivateKey with a 384-bit order → ECDSA-P384-SHA384
  • getAlgorithm() equal to "Ed25519" or "EdDSA"Ed25519
  • getAlgorithm() equal to "ML-DSA-44" / "ML-DSA-65" / "ML-DSA-87" → same string

Callers who need to override the detected algorithm string can use the explicit build(String, byte[], PrivateKey) overload.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setProvider

      public JcaMTCCosigner.Builder setProvider(String providerName)
    • setProvider

      public JcaMTCCosigner.Builder setProvider(Provider provider)
    • build

      public JcaMTCCosigner build(byte[] cosignerId, PrivateKey privateKey)
      Parameters:
      cosignerId - binary trust anchor ID of this cosigner — the CA's own trust anchor ID when the CA itself cosigns (Section 5.3); the cosigner's own trust anchor ID otherwise
      privateKey - JCA private key whose algorithm determines the MTC signature algorithm string (see class javadoc)
      Throws:
      IllegalArgumentException - if the private key type is unsupported
    • build

      public JcaMTCCosigner build(String algorithm, byte[] cosignerId, PrivateKey privateKey)
      Explicit-algorithm overload for cases where the key-type detection in build(byte[], PrivateKey) doesn't apply (e.g. a key whose getAlgorithm() doesn't carry the MTC algorithm name).
      Parameters:
      algorithm - one of the MTCSignatureAlgorithm constants
      cosignerId - binary trust anchor ID of this cosigner — the CA's own trust anchor ID when the CA itself cosigns (Section 5.3); the cosigner's own trust anchor ID otherwise
      privateKey - JCA private key for algorithm