Class EncryptionTest


  • public class EncryptionTest
    extends Object
    A set of test-cases for encrypting and decrypting SOAP requests.
    • Method Detail

      • setUp

        @BeforeEach
        public void setUp()
                   throws Exception
        Setup method
        Throws:
        Exception - Thrown when there is a problem in setup
      • testEncryptionDecryptionRSA15

        @Test
        public void testEncryptionDecryptionRSA15()
                                           throws Exception
        Test that encrypt and decrypt a WS-Security envelope. This test uses the RSA_15 algorithm to transport (wrap) the symmetric key.

        Throws:
        Exception - Thrown when there is any problem in signing or verification
      • testEncryptionDecryptionOAEP

        @Test
        public void testEncryptionDecryptionOAEP()
                                          throws Exception
        Test that encrypt and decrypt a WS-Security envelope. This test uses the RSA OAEP algorithm to transport (wrap) the symmetric key.

        Throws:
        Exception - Thrown when there is any problem in signing or verification
      • testEncryptionDecryptionPublicKey

        @Test
        public void testEncryptionDecryptionPublicKey()
                                               throws Exception
        Throws:
        Exception
      • testEncryptionEncryption

        @Test
        public void testEncryptionEncryption()
                                      throws Exception
        Test that encrypt and then again encrypts (Super encryption) WS-Security envelope and then verifies it

        Throws:
        Exception - Thrown when there is any problem in encryption or verification
      • testX509EncryptionThumb

        @Test
        public void testX509EncryptionThumb()
                                     throws Exception
        Test that encrypts and decrypts a WS-Security envelope. The test uses the ThumbprintSHA1 key identifier type.

        Throws:
        Exception - Thrown when there is any problem in encryption or decryption
      • testX509EncryptionSHA1

        @Test
        public void testX509EncryptionSHA1()
                                    throws Exception
        Test that encrypts and decrypts a WS-Security envelope. The test uses the EncryptedKeySHA1 key identifier type.

        Throws:
        Exception - Thrown when there is any problem in encryption or decryption
      • testEncryptionSHA1Symmetric

        @Test
        public void testEncryptionSHA1Symmetric()
                                         throws Exception
        Test that encrypts using EncryptedKeySHA1, where it uses a symmetric key, rather than a generated session key which is then encrypted using a public key.
        Throws:
        Exception - Thrown when there is any problem in encryption or decryption
      • testEncryptionSHA1SymmetricBytesHandler

        @Test
        public void testEncryptionSHA1SymmetricBytesHandler()
                                                     throws Exception
        Test that encrypts using EncryptedKeySHA1, where it uses a symmetric key, rather than a generated session key which is then encrypted using a public key. The request is generated using WSHandler, instead of coding it.
        Throws:
        Exception - Thrown when there is any problem in encryption or decryption
      • testEncryptionDecryptionRSA15STR

        @Test
        public void testEncryptionDecryptionRSA15STR()
                                              throws Exception
        Test that encrypt and decrypt a WS-Security envelope. This test uses the RSA_15 algorithm to transport (wrap) the symmetric key. The test case creates a ReferenceList element that references EncryptedData elements. The ReferencesList element is put into the Security header, not as child of the EncryptedKey. The EncryptedData elements contain a KeyInfo that references the EncryptedKey via a STR/Reference structure. Refer to OASIS WS Security spec 1.1, chap 7.7
        Throws:
        Exception
      • testBadAttribute

        @Test
        public void testBadAttribute()
                              throws Exception
        Throws:
        Exception
      • testEmbeddedEncryptedKey

        @Test
        public void testEmbeddedEncryptedKey()
                                      throws Exception
        In this test an EncryptedKey structure is embedded in the EncryptedData structure. The EncryptedKey structure refers to a certificate via the SKI_KEY_IDENTIFIER.
        Throws:
        Exception
      • testEncryptionDecryptionOAEPSHA256

        @Test
        public void testEncryptionDecryptionOAEPSHA256()
                                                throws Exception
        Test that encrypt and decrypt a WS-Security envelope. This test uses the RSA OAEP algorithm to transport (wrap) the symmetric key and SHA-256.

        Throws:
        Exception - Thrown when there is any problem in signing or verification
      • testEncryptionWithRegexpCert

        @Test
        public void testEncryptionWithRegexpCert()
                                          throws Exception
        Throws:
        Exception