Class BcMTCSignatureVerifier

  • All Implemented Interfaces:
    MTCSignatureVerifier

    public class BcMTCSignatureVerifier
    extends java.lang.Object
    implements MTCSignatureVerifier
    Lightweight implementation of MTCSignatureVerifier.

    Bound to an AsymmetricKeyParameter and 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".

    • Constructor Summary

      Constructors 
      Constructor Description
      BcMTCSignatureVerifier​(java.lang.String algorithm, org.bouncycastle.crypto.params.AsymmetricKeyParameter publicKey)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAlgorithm()  
      boolean verify​(byte[] cosignedMessage, byte[] signature)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BcMTCSignatureVerifier

        public BcMTCSignatureVerifier​(java.lang.String algorithm,
                                      org.bouncycastle.crypto.params.AsymmetricKeyParameter publicKey)
    • Method Detail

      • getAlgorithm

        public java.lang.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 CosignedMessage bytes
        signature - the candidate signature
        Returns:
        true if the signature is valid for the bound public key and algorithm