Class UTDerivedKeyTest


  • public class UTDerivedKeyTest
    extends Object
    WS-Security Test Case for UsernameToken Key Derivation, as defined in the UsernameTokenProfile 1.1 specification. The derived keys are used to encrypt and sign, as per wsc:DerivedKeyToken.
    • Method Detail

      • testUsernameTokenUnit

        @Test
        public void testUsernameTokenUnit()
                                   throws Exception
        Unit test for the UsernameToken derived key functionality
        Throws:
        Exception
      • testDerivedKeyWithEncodedPasswordBaseline

        @Test
        public void testDerivedKeyWithEncodedPasswordBaseline()
                                                       throws Exception
        Test for encoded passwords.
        Throws:
        Exception
      • testDerivedKeyEncryption

        @Test
        public void testDerivedKeyEncryption()
                                      throws Exception
        Test using a UsernameToken derived key for encrypting a SOAP body
        Throws:
        Exception
      • testDerivedKeyEncryptionWithEncodedPassword

        @Test
        public void testDerivedKeyEncryptionWithEncodedPassword()
                                                         throws Exception
        Test using a UsernameToken derived key for encrypting a SOAP body
        Throws:
        Exception
      • testDerivedKeyChangedEncryption

        @Test
        public void testDerivedKeyChangedEncryption()
                                             throws Exception
        Test using a UsernameToken derived key for encrypting a SOAP body. In this test the derived key is modified before encryption, and so decryption should fail.
        Throws:
        Exception
      • testDerivedKeyBadUserEncryption

        @Test
        public void testDerivedKeyBadUserEncryption()
                                             throws Exception
        Test using a UsernameToken derived key for encrypting a SOAP body. In this test the user is "colm" rather than "bob", and so decryption should fail.
        Throws:
        Exception
      • testDerivedKeySignature

        @Test
        public void testDerivedKeySignature()
                                     throws Exception
        Test using a UsernameToken derived key for signing a SOAP body
        Throws:
        Exception
      • testDerivedKeySignatureWithEncodedPassword

        @Test
        public void testDerivedKeySignatureWithEncodedPassword()
                                                        throws Exception
        Test using a UsernameToken derived key for signing a SOAP body
        Throws:
        Exception
      • testDerivedKeyChangedSignature

        @Test
        public void testDerivedKeyChangedSignature()
                                            throws Exception
        Test using a UsernameToken derived key for signing a SOAP body. In this test the derived key is modified before signature, and so signature verification should fail.
        Throws:
        Exception
      • testDerivedKeyBadUserSignature

        @Test
        public void testDerivedKeyBadUserSignature()
                                            throws Exception
        Test using a UsernameToken derived key for signing a SOAP body. In this test the user is "colm" rather than "bob", and so signature verification should fail.
        Throws:
        Exception
      • testNoSaltEncryption

        @Test
        public void testNoSaltEncryption()
                                  throws Exception
        Unit test for creating a Username Token with no salt element that is used for deriving a key for encryption.
        Throws:
        Exception
      • testNoIterationEncryption

        @Test
        public void testNoIterationEncryption()
                                       throws Exception
        Unit test for creating a Username Token with no iteration element that is used for deriving a key for encryption.
        Throws:
        Exception
      • testLowIterationEncryption

        @Test
        public void testLowIterationEncryption()
                                        throws Exception
        Unit test for creating a Username Token with an iteration value < 1000 that is used for deriving a key for encryption.
        Throws:
        Exception
      • testBadValueType

        @Test
        public void testBadValueType()
                              throws Exception
        Test using a UsernameToken derived key for encrypting a SOAP body. The Reference to the UsernameToken contains a non-standard value type, which is rejected when the corresponding BSP rule is turned on.
        Throws:
        Exception
      • testKeyIdentifier

        @Test
        public void testKeyIdentifier()
                               throws Exception
        Test using a UsernameToken derived key for encrypting a SOAP body. A KeyIdentifier is used to refer to the UsernameToken, which is forbidden by the BSP.
        Throws:
        Exception