Class JcaMTCSignatureVerifier
- java.lang.Object
-
- org.bouncycastle.cert.plants.jcajce.JcaMTCSignatureVerifier
-
- All Implemented Interfaces:
MTCSignatureVerifier
public class JcaMTCSignatureVerifier extends java.lang.Object implements MTCSignatureVerifier
JCA-side implementation ofMTCSignatureVerifier.Bound to a
PublicKeyand one of the algorithm identifiers defined by Section 6.1 of draft-ietf-plants-merkle-tree-certs:"ECDSA-P256-SHA256","ECDSA-P384-SHA384","Ed25519","ML-DSA-44","ML-DSA-65","ML-DSA-87".The draft identifiers are mapped to JCA Signature names internally — the plain (r||s) ECDSA encoding used by MTCProof requires
SHA256WITHPLAIN-ECDSA/SHA384WITHPLAIN-ECDSA, which BC's JCE provider registers (DER-encodedSHA256withECDSAis wire-incompatible with the MTCProof signature byte format).Instances are created via
JcaMTCSignatureVerifier.Builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJcaMTCSignatureVerifier.BuilderBuilder forJcaMTCSignatureVerifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAlgorithm()booleanverify(byte[] cosignedMessage, byte[] signature)
-
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
- Specified by:
getAlgorithmin interfaceMTCSignatureVerifier- Returns:
- the MTC signature algorithm this verifier is bound to — one of
the
MTCSignatureAlgorithmconstants. Lets callers check a registered verifier against the algorithm a CA publishes for its cosigner (Section 5.5sigAlg).
-
verify
public boolean verify(byte[] cosignedMessage, byte[] signature)- Specified by:
verifyin interfaceMTCSignatureVerifier- Parameters:
cosignedMessage- the encoded CosignedMessage bytessignature- the candidate signature- Returns:
- true if the signature is valid for the bound public key and algorithm
-
-