Class SignatureTest


  • public class SignatureTest
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SignatureTest()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void setUpTime()  
      void tearDown()  
      void testInvalidVerifySHA256withECDSA()
      Test invalid signature verification using SHA256withECDSA algorithm with every configured Elliptic Curve key
      void testInvalidVerifySHA256withRSA()
      Test invalid signature verification using SHA256withRSA algorithm with every configured RSA key size
      void testMalformedVerifySHA256withECDSA()
      Test malformed signature verification using SHA256withECDSA algorithm with every configured Elliptic Curve key: the signature is shorter than a valid one and is not DER encoded.
      void testMalformedVerifySHA256withRSA()
      Test malformed signature verification using SHA256withRSA algorithm with every configured RSA key size: the signature is one byte shorter than the modulus.
      void testSignSHA256withECDSA()
      Test signature creation using SHA256withECDSA algorithm with every configured Elliptic Curve key
      void testSignSHA256withRSA()
      Test signature creation using SHA256withRSA algorithm with every configured RSA key size.
      void testVerifySHA256withECDSA()
      Test signature verification using SHA256withECDSA algorithm with every configured Elliptic Curve key
      void testVerifySHA256withRSA()
      Test signature verification using SHA256withRSA algorithm with every configured RSA key size
      • Methods inherited from class java.lang.Object

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

      • SignatureTest

        public SignatureTest()
    • Method Detail

      • setUpTime

        public static void setUpTime()
      • testVerifySHA256withRSA

        public void testVerifySHA256withRSA()
                                     throws java.lang.Exception
        Test signature verification using SHA256withRSA algorithm with every configured RSA key size
        Throws:
        java.lang.Exception
      • testInvalidVerifySHA256withRSA

        public void testInvalidVerifySHA256withRSA()
                                            throws java.lang.Exception
        Test invalid signature verification using SHA256withRSA algorithm with every configured RSA key size
        Throws:
        java.lang.Exception
      • testMalformedVerifySHA256withRSA

        public void testMalformedVerifySHA256withRSA()
                                              throws java.lang.Exception
        Test malformed signature verification using SHA256withRSA algorithm with every configured RSA key size: the signature is one byte shorter than the modulus.
        Throws:
        java.lang.Exception
      • testVerifySHA256withECDSA

        public void testVerifySHA256withECDSA()
                                       throws java.lang.Exception
        Test signature verification using SHA256withECDSA algorithm with every configured Elliptic Curve key
        Throws:
        java.lang.Exception
      • testInvalidVerifySHA256withECDSA

        public void testInvalidVerifySHA256withECDSA()
                                              throws java.lang.Exception
        Test invalid signature verification using SHA256withECDSA algorithm with every configured Elliptic Curve key
        Throws:
        java.lang.Exception
      • testMalformedVerifySHA256withECDSA

        public void testMalformedVerifySHA256withECDSA()
                                                throws java.lang.Exception
        Test malformed signature verification using SHA256withECDSA algorithm with every configured Elliptic Curve key: the signature is shorter than a valid one and is not DER encoded.
        Throws:
        java.lang.Exception
      • testSignSHA256withRSA

        public void testSignSHA256withRSA()
                                   throws java.lang.Exception
        Test signature creation using SHA256withRSA algorithm with every configured RSA key size.

        PKCS#1 v1.5 signing is deterministic, so the signature computed by the backend must match, byte for byte, the signature of the same data that the test material holds for the same private key.

        Throws:
        java.lang.Exception
      • testSignSHA256withECDSA

        public void testSignSHA256withECDSA()
                                     throws java.lang.Exception
        Test signature creation using SHA256withECDSA algorithm with every configured Elliptic Curve key
        Throws:
        java.lang.Exception
      • tearDown

        public void tearDown()