org.apache.ws.security.message
Class SignatureTest

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

public class SignatureTest
extends org.junit.Assert

A set of test-cases for signing and verifying SOAP requests.

Author:
Davanum Srinivas (dims@yahoo.com), Werner Dittmann (Werner.Dittmann@siemens.com)

Constructor Summary
SignatureTest()
           
 
Method Summary
 void testBSTPKIPathSignature()
          Test that signs and verifies a WS-Security envelope

 void testBSTSignature()
          Test that signs and verifies a WS-Security envelope

 void testCustomSTR()
          Create a signature that uses a custom SecurityTokenReference.
 void testDoubleX509SignatureIS()
          Test that signs (twice) and verifies a WS-Security envelope.
 void testDoubleX509SignatureThumb()
          Test that signs (twice) and verifies a WS-Security envelope.
 void testIssuerSerialSignature()
          Test that signs and verifies a WS-Security envelope

 void testSignatureInclusiveC14N()
          Test that signs and verifies a WS-Security envelope

 void testSignatureInclusivePrefixes()
          Test that signs and verifies a WS-Security envelope

 void testSignedTimestamp()
          Test that signs and verifies a Timestamp.
 void testValidModifiedSignature()
          Test that signs and verifies a Timestamp.
 void testWSS170()
          A test for "SignatureAction does not set DigestAlgorithm on WSSecSignature instance"
 void testWSS231()
          A test for "There is an issue with the position of the element in the header when using WSS4J calling .NET Web Services with WS-Security."
 void testWSS234()
          This is a test for WSS-234 - "When a document contains a comment as its first child element, wss4j will not find the SOAP body."
 void testWSS283()
          This is a test for WSS-283 - "ClassCastException when signing message with existing WSSE header containing Text as first child": https://issues.apache.org/jira/browse/WSS-283
 void testX509Signature()
          Test that signs and verifies a WS-Security envelope

 void testX509SignatureDefaultPassword()
          The test uses the Issuer Serial key identifier type.
 void testX509SignatureIS()
          The test uses the Issuer Serial key identifier type.
 void testX509SignatureSha256()
          Sign using a different digest algorithm (SHA-256).
 void testX509SignatureThumb()
          Test that signs and verifies a WS-Security envelope.
 
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

SignatureTest

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

testX509SignatureIS

public void testX509SignatureIS()
                         throws java.lang.Exception
The test uses the Issuer Serial key identifier type.

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testDoubleX509SignatureIS

public void testDoubleX509SignatureIS()
                               throws java.lang.Exception
Test that signs (twice) and verifies a WS-Security envelope.

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testIssuerSerialSignature

public void testIssuerSerialSignature()
                               throws java.lang.Exception
Test that signs and verifies a WS-Security envelope

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testSignatureInclusiveC14N

public void testSignatureInclusiveC14N()
                                throws java.lang.Exception
Test that signs and verifies a WS-Security envelope

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testSignatureInclusivePrefixes

public void testSignatureInclusivePrefixes()
                                    throws java.lang.Exception
Test that signs and verifies a WS-Security envelope

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testBSTSignature

public void testBSTSignature()
                      throws java.lang.Exception
Test that signs and verifies a WS-Security envelope

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testBSTPKIPathSignature

public void testBSTPKIPathSignature()
                             throws java.lang.Exception
Test that signs and verifies a WS-Security envelope

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testX509Signature

public void testX509Signature()
                       throws java.lang.Exception
Test that signs and verifies a WS-Security envelope

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testX509SignatureThumb

public void testX509SignatureThumb()
                            throws java.lang.Exception
Test that signs and verifies a WS-Security envelope. The test uses the ThumbprintSHA1 key identifier type.

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testDoubleX509SignatureThumb

public void testDoubleX509SignatureThumb()
                                  throws java.lang.Exception
Test that signs (twice) and verifies a WS-Security envelope. The test uses the ThumbprintSHA1 key identifier type.

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testValidModifiedSignature

public void testValidModifiedSignature()
                                throws java.lang.Exception
Test that signs and verifies a Timestamp. The request is then modified so that the Timestamp has a default (WSU) namespace inserted. The signature validation should still pass due to c14n (see WSS-181).

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testX509SignatureSha256

public void testX509SignatureSha256()
                             throws java.lang.Exception
Sign using a different digest algorithm (SHA-256).

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testWSS170

public void testWSS170()
                throws java.lang.Exception
A test for "SignatureAction does not set DigestAlgorithm on WSSecSignature instance"

Throws:
java.lang.Exception

testWSS234

public void testWSS234()
                throws java.lang.Exception
This is a test for WSS-234 - "When a document contains a comment as its first child element, wss4j will not find the SOAP body."

Throws:
java.lang.Exception

testSignedTimestamp

public void testSignedTimestamp()
                         throws java.lang.Exception
Test that signs and verifies a Timestamp. The Signature element is appended to the security header, and so appears after the Timestamp element.

Throws:
java.lang.Exception

testWSS283

public void testWSS283()
                throws java.lang.Exception
This is a test for WSS-283 - "ClassCastException when signing message with existing WSSE header containing Text as first child": https://issues.apache.org/jira/browse/WSS-283

Throws:
java.lang.Exception

testCustomSTR

public void testCustomSTR()
                   throws java.lang.Exception
Create a signature that uses a custom SecurityTokenReference.

Throws:
java.lang.Exception

testX509SignatureDefaultPassword

public void testX509SignatureDefaultPassword()
                                      throws java.lang.Exception
The test uses the Issuer Serial key identifier type.

Throws:
java.lang.Exception - Thrown when there is any problem in signing or verification

testWSS231

public void testWSS231()
                throws java.lang.Exception
A test for "There is an issue with the position of the element in the header when using WSS4J calling .NET Web Services with WS-Security."

Throws:
java.lang.Exception


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