org.apache.ws.security.message
Class UTDerivedKeyTest

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.ws.security.message.UTDerivedKeyTest

public class UTDerivedKeyTest
extends org.junit.Assert

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.


Constructor Summary
UTDerivedKeyTest()
           
 
Method Summary
 void testBadValueType()
          Test using a UsernameToken derived key for encrypting a SOAP body.
 void testDerivedKeyBadUserEncryption()
          Test using a UsernameToken derived key for encrypting a SOAP body.
 void testDerivedKeyBadUserSignature()
          Test using a UsernameToken derived key for signing a SOAP body.
 void testDerivedKeyChangedEncryption()
          Test using a UsernameToken derived key for encrypting a SOAP body.
 void testDerivedKeyChangedSignature()
          Test using a UsernameToken derived key for signing a SOAP body.
 void testDerivedKeyEncryption()
          Test using a UsernameToken derived key for encrypting a SOAP body
 void testDerivedKeyEncryptionWithEncodedPassword()
          Test using a UsernameToken derived key for encrypting a SOAP body
 void testDerivedKeySignature()
          Test using a UsernameToken derived key for signing a SOAP body
 void testDerivedKeySignatureWithEncodedPassword()
          Test using a UsernameToken derived key for signing a SOAP body
 void testDerivedKeyWithEncodedPasswordBaseline()
          Test for encoded passwords.
 void testKeyIdentifier()
          Test using a UsernameToken derived key for encrypting a SOAP body.
 void testLowIterationEncryption()
          Unit test for creating a Username Token with an iteration value < 1000 that is used for deriving a key for encryption.
 void testNoIterationEncryption()
          Unit test for creating a Username Token with no iteration element that is used for deriving a key for encryption.
 void testNoSaltEncryption()
          Unit test for creating a Username Token with no salt element that is used for deriving a key for encryption.
 void testUsernameTokenUnit()
          Unit test for the UsernameToken derived key functionality
 
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UTDerivedKeyTest

public UTDerivedKeyTest()
                 throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

testUsernameTokenUnit

public void testUsernameTokenUnit()
                           throws java.lang.Exception
Unit test for the UsernameToken derived key functionality

Throws:
java.lang.Exception

testDerivedKeyWithEncodedPasswordBaseline

public void testDerivedKeyWithEncodedPasswordBaseline()
                                               throws java.lang.Exception
Test for encoded passwords.

Throws:
java.lang.Exception

testDerivedKeyEncryption

public void testDerivedKeyEncryption()
                              throws java.lang.Exception
Test using a UsernameToken derived key for encrypting a SOAP body

Throws:
java.lang.Exception

testDerivedKeyEncryptionWithEncodedPassword

public void testDerivedKeyEncryptionWithEncodedPassword()
                                                 throws java.lang.Exception
Test using a UsernameToken derived key for encrypting a SOAP body

Throws:
java.lang.Exception

testDerivedKeyChangedEncryption

public void testDerivedKeyChangedEncryption()
                                     throws java.lang.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:
java.lang.Exception

testDerivedKeyBadUserEncryption

public void testDerivedKeyBadUserEncryption()
                                     throws java.lang.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:
java.lang.Exception

testDerivedKeySignature

public void testDerivedKeySignature()
                             throws java.lang.Exception
Test using a UsernameToken derived key for signing a SOAP body

Throws:
java.lang.Exception

testDerivedKeySignatureWithEncodedPassword

public void testDerivedKeySignatureWithEncodedPassword()
                                                throws java.lang.Exception
Test using a UsernameToken derived key for signing a SOAP body

Throws:
java.lang.Exception

testDerivedKeyChangedSignature

public void testDerivedKeyChangedSignature()
                                    throws java.lang.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:
java.lang.Exception

testDerivedKeyBadUserSignature

public void testDerivedKeyBadUserSignature()
                                    throws java.lang.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:
java.lang.Exception

testNoSaltEncryption

public void testNoSaltEncryption()
                          throws java.lang.Exception
Unit test for creating a Username Token with no salt element that is used for deriving a key for encryption.

Throws:
java.lang.Exception

testNoIterationEncryption

public void testNoIterationEncryption()
                               throws java.lang.Exception
Unit test for creating a Username Token with no iteration element that is used for deriving a key for encryption.

Throws:
java.lang.Exception

testLowIterationEncryption

public void testLowIterationEncryption()
                                throws java.lang.Exception
Unit test for creating a Username Token with an iteration value < 1000 that is used for deriving a key for encryption.

Throws:
java.lang.Exception

testBadValueType

public void testBadValueType()
                      throws java.lang.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 BSP compliance is turned on.

Throws:
java.lang.Exception

testKeyIdentifier

public void testKeyIdentifier()
                       throws java.lang.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:
java.lang.Exception


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.