Class JcaMTCCosigner.Builder

  • Enclosing class:
    JcaMTCCosigner

    public static class JcaMTCCosigner.Builder
    extends java.lang.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[], java.security.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 Detail

      • Builder

        public Builder()
    • Method Detail

      • build

        public JcaMTCCosigner build​(byte[] cosignerId,
                                    java.security.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:
        java.lang.IllegalArgumentException - if the private key type is unsupported
      • build

        public JcaMTCCosigner build​(java.lang.String algorithm,
                                    byte[] cosignerId,
                                    java.security.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