Class RSACipherTest


  • public class RSACipherTest
    extends java.lang.Object
    • Constructor Detail

      • RSACipherTest

        public RSACipherTest()
    • Method Detail

      • keyPairArrayGeneration

        public static void keyPairArrayGeneration()
                                           throws java.lang.Exception
        Generate the RSA key pair list.
        Throws:
        java.lang.Exception - if the generation fails.
      • testRSA_PKCS1Padding_SinglePart_1byte

        public void testRSA_PKCS1Padding_SinglePart_1byte()
                                                   throws java.lang.Exception
        Test the "RSA/ECB/PKCS1Padding" cipher with a single-part operation containing 1 byte of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_PKCS1Padding_SinglePart_16bytes

        public void testRSA_PKCS1Padding_SinglePart_16bytes()
                                                     throws java.lang.Exception
        Test the "RSA/ECB/PKCS1Padding" cipher with a single-part operation containing 16 bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_PKCS1Padding_MultiPart_16bytes

        public void testRSA_PKCS1Padding_MultiPart_16bytes()
                                                    throws java.lang.Exception
        Test the "RSA/ECB/PKCS1Padding" cipher with a multi-part operation containing 16 bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_PKCS1Padding_SinglePart_maxBytes

        public void testRSA_PKCS1Padding_SinglePart_maxBytes()
                                                      throws java.lang.Exception
        Test the "RSA/ECB/PKCS1Padding" cipher with a single-part operation containing max bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_PKCS1Padding_SinglePart_lengthError

        public void testRSA_PKCS1Padding_SinglePart_lengthError()
                                                         throws java.lang.Exception
        Test the "RSA/ECB/PKCS1Padding" cipher with a single-part operation containing a big input data that is expected to throw an exception.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_1byte

        public void testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_1byte()
                                                                 throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-1AndMGF1Padding" cipher with a single-part operation containing 1 byte of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_16bytes

        public void testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_16bytes()
                                                                   throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-1AndMGF1Padding" cipher with a single-part operation containing 16 bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA1AndMGF1Padding_MultiPart_16bytes

        public void testRSA_OAEPWithSHA1AndMGF1Padding_MultiPart_16bytes()
                                                                  throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-1AndMGF1Padding" cipher with a multi-part operation containing 16 bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_maxBytes

        public void testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_maxBytes()
                                                                    throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-1AndMGF1Padding" cipher with a single-part operation containing max bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_lengthError

        public void testRSA_OAEPWithSHA1AndMGF1Padding_SinglePart_lengthError()
                                                                       throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-1AndMGF1Padding" cipher with a single-part operation containing a big input data that is expected to throw an exception.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_1byte

        public void testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_1byte()
                                                                   throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" cipher with a single-part operation containing 1 byte of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_16bytes

        public void testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_16bytes()
                                                                     throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" cipher with a single-part operation containing 16 bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA256AndMGF1Padding_MultiPart_16bytes

        public void testRSA_OAEPWithSHA256AndMGF1Padding_MultiPart_16bytes()
                                                                    throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" cipher with a multi-part operation containing 16 bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_maxBytes

        public void testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_maxBytes()
                                                                      throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" cipher with a single-part operation containing max bytes of input data.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_lengthError

        public void testRSA_OAEPWithSHA256AndMGF1Padding_SinglePart_lengthError()
                                                                         throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" cipher with a single-part operation containing a big input data that is expected to throw an exception.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.
      • testRSA_OAEP_params

        public void testRSA_OAEP_params()
                                 throws java.lang.Exception
        Test the "RSA/ECB/OAEPWithdigestAndMGF1Padding" cipher with a single-part operation containing 1 byte of input data and explicit OAEP encryption parameters.
        Throws:
        java.lang.Exception - if the encryption or decryption fails.