Class JcaMTCSignatureVerifier

java.lang.Object
org.bouncycastle.cert.plants.jcajce.JcaMTCSignatureVerifier
All Implemented Interfaces:
MTCSignatureVerifier

public class JcaMTCSignatureVerifier extends Object implements MTCSignatureVerifier
JCA-side implementation of MTCSignatureVerifier.

Bound to a PublicKey and one of the canonical algorithm names in MTCSignatureAlgorithm, for an algorithm this package binds (the draft itself fixes no list; see MTCSignatureAlgorithm): "ECDSA-P256-SHA256", "ECDSA-P384-SHA384", "Ed25519", "ML-DSA-44", "ML-DSA-65", "ML-DSA-87".

The algorithm names are mapped to JCA Signature names internally; the two ECDSA names map to SHA256withECDSA / SHA384withECDSA, so an ECDSA cosignature is the DER-encoded X9.62 ECDSA-Sig-Value, the form the working group's reference implementation uses.

Instances are created via JcaMTCSignatureVerifier.Builder.

  • Method Details

    • getAlgorithm

      public String getAlgorithm()
      Specified by:
      getAlgorithm in interface MTCSignatureVerifier
      Returns:
      the MTC signature algorithm this verifier is bound to — one of the MTCSignatureAlgorithm constants. Lets callers check a registered verifier against the algorithm a CA publishes for its cosigner (Section 5.5 sigAlg).
    • verify

      public boolean verify(byte[] cosignedMessage, byte[] signature)
      Specified by:
      verify in interface MTCSignatureVerifier
      Parameters:
      cosignedMessage - the encoded CosignedSubtree bytes
      signature - the candidate signature
      Returns:
      true if the signature is valid for the bound public key and algorithm