Package org.apache.wss4j.dom.message
Class SignatureTest
- java.lang.Object
-
- org.apache.wss4j.dom.message.SignatureTest
-
public class SignatureTest extends Object
A set of test-cases for signing and verifying SOAP requests.
-
-
Constructor Summary
Constructors Constructor Description SignatureTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testBSTPKIPathSignature()
Test that signs and verifies a WS-Security envelopevoid
testBSTSignature()
Test that signs and verifies a WS-Security envelopevoid
testCommentInSOAPBody()
void
testCustomKeyInfoElementCreation()
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
testEncryptSignatureTimestampOrder()
void
testIssuerSerialSignature()
Test that signs and verifies a WS-Security envelopevoid
testLoadSignaturePropertiesFromFileSystem()
void
testSignatureEncryptTimestampOrder()
void
testSignatureInclusiveC14N()
Test that signs and verifies a WS-Security envelopevoid
testSignatureInclusivePrefixes()
Test that signs and verifies a WS-Security envelopevoid
testSignedTimestamp()
Test that signs and verifies a Timestamp.void
testValidModifiedSignature()
Test that signs and verifies a Timestamp.void
testWSHandlerSignatureCanonicalization()
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 theelement 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-283void
testX509Signature()
Test that signs and verifies a WS-Security envelopevoid
testX509SignatureDefaultPassword()
The test uses the Issuer Serial key identifier type.void
testX509SignatureIS()
The test uses the Issuer Serial key identifier type.void
testX509SignatureISAttached()
void
testX509SignatureSha256()
Sign using a different digest algorithm (SHA-256).void
testX509SignatureSha512()
void
testX509SignatureThumb()
Test that signs and verifies a WS-Security envelope.void
testX509SignatureThumbAttached()
-
-
-
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 theelement 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
-
-