Author: coheigea
Date: Wed May 26 10:39:59 2010
New Revision: 948388
URL: http://svn.apache.org/viewvc?rev=948388&view=rev
Log:
Added a test to programatically construct a PKIPATH BinarySecurityToken.
Modified:
webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
Modified:
webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java?rev=948388&r1=948387&r2=948388&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
(original)
+++ webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
Wed May 26 10:39:59 2010
@@ -155,6 +155,7 @@ public class TestWSSecurityNew3 extends
Document doc = unsignedEnvelope.getAsDocument();
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
+
Document signedDoc = builder.build(doc, crypto, secHeader);
if (LOG.isDebugEnabled()) {
@@ -173,6 +174,35 @@ public class TestWSSecurityNew3 extends
*
* @throws java.lang.Exception Thrown when there is any problem in signing
or verification
*/
+ public void testBSTPKIPathSignature() throws Exception {
+ WSSecSignature builder = new WSSecSignature();
+ builder.setUserInfo("wss40", "security");
+ builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
+ builder.setUseSingleCertificate(false);
+ LOG.info("Before Signing....");
+ Document doc = unsignedEnvelope.getAsDocument();
+ WSSecHeader secHeader = new WSSecHeader();
+ secHeader.insertSecurityHeader(doc);
+
+ Crypto pkiCrypto = CryptoFactory.getInstance("wss40.properties");
+ Document signedDoc = builder.build(doc, pkiCrypto, secHeader);
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("After PKI Signing....");
+ String outputString =
+
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);
+ LOG.debug(outputString);
+ }
+
+ secEngine.processSecurityHeader(doc, null, this, pkiCrypto, null);
+ }
+
+ /**
+ * Test that signs and verifies a WS-Security envelope
+ * <p/>
+ *
+ * @throws java.lang.Exception Thrown when there is any problem in signing
or verification
+ */
public void testSignatureInclusivePrefixes() throws Exception {
WSSConfig wssConfig = WSSConfig.getNewInstance();
wssConfig.setWsiBSPCompliant(true);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]