Class SignatureTest


  • public class SignatureTest
    extends Object
    A set of test-cases for signing and verifying SOAP requests.
    • Method Detail

      • testX509SignatureIS

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

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

        @Test
        public void testX509SignatureISAttached()
                                         throws Exception
        Throws:
        Exception
      • testDoubleX509SignatureIS

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        @Test
        public void testX509SignatureThumbAttached()
                                            throws Exception
        Throws:
        Exception
      • testDoubleX509SignatureThumb

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

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

        @Test
        public void testValidModifiedSignature()
                                        throws 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:
        Exception - Thrown when there is any problem in signing or verification
      • testX509SignatureSha256

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

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

        @Test
        public void testX509SignatureSha512()
                                     throws Exception
        Throws:
        Exception
      • testWSS170

        @Test
        public void testWSS170()
                        throws Exception
        A test for "SignatureAction does not set DigestAlgorithm on WSSecSignature instance"
        Throws:
        Exception
      • testWSS234

        @Test
        public void testWSS234()
                        throws 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:
        Exception
      • testSignedTimestamp

        @Test
        public void testSignedTimestamp()
                                 throws 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:
        Exception
      • testWSS283

        @Test
        public void testWSS283()
                        throws 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:
        Exception
      • testCustomSTR

        @Test
        public void testCustomSTR()
                           throws Exception
        Create a signature that uses a custom SecurityTokenReference.
        Throws:
        Exception
      • testX509SignatureDefaultPassword

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

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

        @Test
        public void testWSS231()
                        throws 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:
        Exception
      • testSignatureEncryptTimestampOrder

        @Test
        public void testSignatureEncryptTimestampOrder()
                                                throws Exception
        Throws:
        Exception
      • testEncryptSignatureTimestampOrder

        @Test
        public void testEncryptSignatureTimestampOrder()
                                                throws Exception
        Throws:
        Exception
      • testWSHandlerSignatureCanonicalization

        @Test
        public void testWSHandlerSignatureCanonicalization()
                                                    throws Exception
        Throws:
        Exception
      • testLoadSignaturePropertiesFromFileSystem

        @Test
        public void testLoadSignaturePropertiesFromFileSystem()
                                                       throws Exception
        Throws:
        Exception
      • testCommentInSOAPBody

        @Test
        public void testCommentInSOAPBody()
                                   throws Exception
        Throws:
        Exception
      • testCustomKeyInfoElementCreation

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