You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by gi...@apache.org on 2011/10/11 20:03:15 UTC
svn commit: r1181995 [3/26] - in /webservices/wss4j/branches/swssf: ./
cxf-integration/ cxf-integration/src/main/java/org/swssf/cxfIntegration/
cxf-integration/src/main/java/org/swssf/cxfIntegration/interceptor/
cxf-integration/src/main/java/org/swssf/...
Copied: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/PolicyTest.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/test/policy/PolicyTest.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/PolicyTest.java?p2=webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/PolicyTest.java&p1=webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/test/policy/PolicyTest.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/test/policy/PolicyTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/PolicyTest.java Tue Oct 11 18:03:00 2011
@@ -16,20 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.test.policy;
+package org.swssf.policy.test;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurePart;
-import org.swssf.ext.SecurityProperties;
-import org.swssf.impl.securityToken.HttpsSecurityToken;
import org.swssf.policy.PolicyEnforcer;
import org.swssf.policy.PolicyEnforcerFactory;
import org.swssf.policy.PolicyInputProcessor;
import org.swssf.policy.PolicyViolationException;
-import org.swssf.securityEvent.HttpsTokenSecurityEvent;
-import org.swssf.securityEvent.SecurityEvent;
-import org.swssf.test.AbstractTestBase;
-import org.swssf.test.CallbackHandlerImpl;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSSecurityProperties;
+import org.swssf.wss.impl.securityToken.HttpsSecurityToken;
+import org.swssf.wss.securityEvent.HttpsTokenSecurityEvent;
+import org.swssf.wss.securityEvent.SecurityEvent;
+import org.swssf.wss.test.AbstractTestBase;
+import org.swssf.wss.test.CallbackHandlerImpl;
+import org.swssf.xmlsec.ext.SecurePart;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
@@ -50,25 +50,25 @@ public class PolicyTest extends Abstract
@Test
public void testAsymmetricBindingIncludeTimestampPolicy() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -94,25 +94,25 @@ public class PolicyTest extends Abstract
@Test
public void testAsymmetricBindingIncludeTimestampPolicyNegativeTest() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -143,29 +143,29 @@ public class PolicyTest extends Abstract
@Test
public void testAsymmetricBindingIncludeTimestampAndSignedUsernameSupportingTokenPolicy() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.setTokenUser("transmitter");
- outSecurityProperties.setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType.PASSWORD_NONE);
+ outSecurityProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsse_UsernameToken.getLocalPart(), Constants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.USERNAMETOKEN, Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsse_UsernameToken.getLocalPart(), WSSConstants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.USERNAMETOKEN, WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -191,29 +191,29 @@ public class PolicyTest extends Abstract
@Test
public void testAsymmetricBindingIncludeTimestampAndSignedUsernameSupportingTokenPolicyNegativeTest() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.setTokenUser("transmitter");
- outSecurityProperties.setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType.PASSWORD_NONE);
+ outSecurityProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- //outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsse_UsernameToken.getLocalPart(), Constants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.USERNAMETOKEN, Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ //outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsse_UsernameToken.getLocalPart(), WSSConstants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.USERNAMETOKEN, WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -244,29 +244,29 @@ public class PolicyTest extends Abstract
@Test
public void testAsymmetricBindingIncludeTimestampAndProtectionOrderSignBeforeEncryptAndSignedUsernameSupportingTokenPolicyNegativeTest() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.setTokenUser("transmitter");
- outSecurityProperties.setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType.PASSWORD_NONE);
+ outSecurityProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsse_UsernameToken.getLocalPart(), Constants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.USERNAMETOKEN, Constants.Action.TIMESTAMP, Constants.Action.ENCRYPT, Constants.Action.SIGNATURE};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsse_UsernameToken.getLocalPart(), WSSConstants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.USERNAMETOKEN, WSSConstants.TIMESTAMP, WSSConstants.ENCRYPT, WSSConstants.SIGNATURE};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -292,29 +292,29 @@ public class PolicyTest extends Abstract
@Test
public void testTransportBindingBasicAuthenticationIncludeTimestampAndSignedUsernameSupportingTokenPolicy() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.setTokenUser("transmitter");
- outSecurityProperties.setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType.PASSWORD_NONE);
+ outSecurityProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- //outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsse_UsernameToken.getLocalPart(), Constants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.USERNAMETOKEN, Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ //outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsse_UsernameToken.getLocalPart(), WSSConstants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.USERNAMETOKEN, WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -346,29 +346,29 @@ public class PolicyTest extends Abstract
@Test
public void testTransportBindingBasicAuthenticationIncludeTimestampAndSignedUsernameSupportingTokenPolicyNegativeTest() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.setTokenUser("transmitter");
- outSecurityProperties.setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType.PASSWORD_NONE);
+ outSecurityProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- //outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsse_UsernameToken.getLocalPart(), Constants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.USERNAMETOKEN, Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ //outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsse_UsernameToken.getLocalPart(), WSSConstants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.USERNAMETOKEN, WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -407,29 +407,29 @@ public class PolicyTest extends Abstract
@Test
public void testTransportBindingHttpsClientAuthenticationIncludeTimestampAndSignedUsernameSupportingTokenPolicy() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.setTokenUser("transmitter");
- outSecurityProperties.setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType.PASSWORD_NONE);
+ outSecurityProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE);
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- //outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsse_UsernameToken.getLocalPart(), Constants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
- //outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Created.getLocalPart(), Constants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_wsu_Expires.getLocalPart(), Constants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.USERNAMETOKEN, Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ //outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsse_UsernameToken.getLocalPart(), WSSConstants.TAG_wsse_UsernameToken.getNamespaceURI(), SecurePart.Modifier.Element));
+ //outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Created.getLocalPart(), WSSConstants.TAG_wsu_Created.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_wsu_Expires.getLocalPart(), WSSConstants.TAG_wsu_Expires.getNamespaceURI(), SecurePart.Modifier.Content));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.USERNAMETOKEN, WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
Copied: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/test/policy/VulnerabliltyVectorsTest.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java?p2=webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java&p1=webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/test/policy/VulnerabliltyVectorsTest.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/test/policy/VulnerabliltyVectorsTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java Tue Oct 11 18:03:00 2011
@@ -16,19 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.test.policy;
+package org.swssf.policy.test;
import org.apache.ws.security.handler.WSHandlerConstants;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurePart;
-import org.swssf.ext.SecurityProperties;
-import org.swssf.ext.WSSecurityException;
import org.swssf.policy.PolicyEnforcer;
import org.swssf.policy.PolicyEnforcerFactory;
import org.swssf.policy.PolicyInputProcessor;
import org.swssf.policy.secpolicy.WSSPolicyException;
-import org.swssf.test.AbstractTestBase;
-import org.swssf.test.CallbackHandlerImpl;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSSecurityProperties;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.wss.test.AbstractTestBase;
+import org.swssf.wss.test.CallbackHandlerImpl;
+import org.swssf.xmlsec.ext.SecurePart;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
@@ -56,24 +56,24 @@ public class VulnerabliltyVectorsTest ex
*/
@Test
public void testSOAPActionSpoofing() throws Exception {
- SecurityProperties outSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties outSecurityProperties = new WSSSecurityProperties();
outSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outSecurityProperties.setEncryptionUser("receiver");
outSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outSecurityProperties.setSignatureUser("transmitter");
outSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_wsu_Timestamp.getLocalPart(), Constants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
- outSecurityProperties.addSignaturePart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Element));
- outSecurityProperties.addEncryptionPart(new SecurePart(Constants.TAG_soap_Body_LocalName, Constants.NS_SOAP11, SecurePart.Modifier.Content));
- Constants.Action[] actions = new Constants.Action[]{Constants.Action.TIMESTAMP, Constants.Action.SIGNATURE, Constants.Action.ENCRYPT};
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_wsu_Timestamp.getLocalPart(), WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), SecurePart.Modifier.Element));
+ outSecurityProperties.addSignaturePart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Element));
+ outSecurityProperties.addEncryptionPart(new SecurePart(WSSConstants.TAG_soap_Body_LocalName, WSSConstants.NS_SOAP11, SecurePart.Modifier.Content));
+ WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.TIMESTAMP, WSSConstants.SIGNATURE, WSSConstants.ENCRYPT};
outSecurityProperties.setOutAction(actions);
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outSecurityProperties, sourceDocument);
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
@@ -108,7 +108,7 @@ public class VulnerabliltyVectorsTest ex
Element soapEnvElement = (Element) bodyElement.getParentNode();
soapEnvElement.removeChild(bodyElement);
- Element newBody = securedDocument.createElementNS(Constants.NS_SOAP11, Constants.TAG_soap_Body_LocalName);
+ Element newBody = securedDocument.createElementNS(WSSConstants.NS_SOAP11, WSSConstants.TAG_soap_Body_LocalName);
soapEnvElement.appendChild(newBody);
xPathExpression = getXPath("/env:Envelope/env:Header");
@@ -120,7 +120,7 @@ public class VulnerabliltyVectorsTest ex
javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
transformer.transform(new DOMSource(securedDocument), new StreamResult(baos));
- SecurityProperties inSecurityProperties = new SecurityProperties();
+ WSSSecurityProperties inSecurityProperties = new WSSSecurityProperties();
inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
Added: webservices/wss4j/branches/swssf/streaming-ws-policy/streaming-ws-policy.iml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/streaming-ws-policy.iml?rev=1181995&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/streaming-ws-policy.iml (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/streaming-ws-policy.iml Tue Oct 11 18:03:00 2011
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="streaming-ws-security" />
+ <orderEntry type="module" module-name="streaming-xml-security" />
+ <orderEntry type="library" name="Maven: org.codehaus.woodstox:wstx-asl:3.2.9" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" />
+ <orderEntry type="library" name="Maven: jcs:jcs:1.3" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.4" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging-api:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: commons-digester:commons-digester:1.8" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils-core:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: commons-jxpath:commons-jxpath:1.2" level="project" />
+ <orderEntry type="library" name="Maven: ant:ant-optional:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: jdom:jdom:b9" level="project" />
+ <orderEntry type="library" name="Maven: concurrent:concurrent:1.0" level="project" />
+ <orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.1" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.45" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.4.4" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.4.1" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.4.1" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.neethi:neethi:2.0.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-api:1.2.7" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.2" level="project" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.1" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-impl:1.2.7" level="project" />
+ <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.2" level="project" />
+ <orderEntry type="module" module-name="streaming-xml-security" scope="TEST" />
+ <orderEntry type="module" module-name="streaming-ws-security" scope="TEST" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.testng:testng:5.14.2" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.beanshell:bsh:2.0b4" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.inject:guice:2.0" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.10" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.apache.ws.security:wss4j:1.6.0" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: xalan:serializer:2.7.1" level="project" />
+ </component>
+</module>
+
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/pom.xml?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/pom.xml (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/pom.xml Tue Oct 11 18:03:00 2011
@@ -15,36 +15,14 @@
<name>Streaming WebService Security</name>
<properties>
- <bcprov.version>1.45</bcprov.version>
<opensaml.version>2.4.1</opensaml.version>
</properties>
<dependencies>
<dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.9</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.4</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.swssf</groupId>
+ <artifactId>streaming-xml-security</artifactId>
+ <version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
@@ -123,70 +101,14 @@
</exclusion>
</exclusions>
</dependency>
+
<dependency>
- <groupId>jcs</groupId>
- <artifactId>jcs</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>javax.sql</groupId>
- <artifactId>jdbc-stdext</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- </exclusion>
- <exclusion>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>servletapi</groupId>
- <artifactId>servletapi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>tomcat-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>velocity</groupId>
- <artifactId>velocity</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlrpc</groupId>
- <artifactId>xmlrpc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xerces</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>berkeleydb</groupId>
- <artifactId>berkeleydb</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.swssf</groupId>
+ <artifactId>streaming-xml-security</artifactId>
+ <version>1.0.0</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
</dependency>
-
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
@@ -270,33 +192,4 @@
</plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>jdk15</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- <jdk>1.5</jdk>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
- <version>${bcprov.version}</version>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>jdk16</id>
- <activation>
- <jdk>1.6</jdk>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk16</artifactId>
- <version>${bcprov.version}</version>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
</project>
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/DerivedKeyTokenType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/DerivedKeyTokenType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/DerivedKeyTokenType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/DerivedKeyTokenType.java Tue Oct 11 18:03:00 2011
@@ -21,10 +21,10 @@
package org.oasis_open.docs.ws_sx.ws_secureconversation._200512;
import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.SecurityTokenReferenceType;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
@@ -114,9 +114,9 @@ public class DerivedKeyTokenType impleme
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_wsu_Id)) {
+ if (attribute.getName().equals(WSSConstants.ATT_wsu_Id)) {
this.id = attribute.getValue();
- } else if (attribute.getName().equals(Constants.ATT_NULL_Algorithm)) {
+ } else if (attribute.getName().equals(WSSConstants.ATT_NULL_Algorithm)) {
this.algorithm = attribute.getValue();
}
}
@@ -136,11 +136,11 @@ public class DerivedKeyTokenType impleme
case XMLStreamConstants.START_ELEMENT:
StartElement startElement = xmlEvent.asStartElement();
- if (startElement.getName().equals(Constants.TAG_wsse_SecurityTokenReference)) {
+ if (startElement.getName().equals(WSSConstants.TAG_wsse_SecurityTokenReference)) {
currentParseable = securityTokenReference = new SecurityTokenReferenceType(startElement);
- } else if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Properties.getLocalPart())) {
+ } else if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Properties.getLocalPart())) {
currentParseable = properties = new PropertiesType(startElement);
- } else if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Generation.getLocalPart())) {
+ } else if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Generation.getLocalPart())) {
currentParseable = new Parseable() {
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
switch (xmlEvent.getEventType()) {
@@ -159,7 +159,7 @@ public class DerivedKeyTokenType impleme
public void validate() throws ParseException {
}
};
- } else if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Offset.getLocalPart())) {
+ } else if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Offset.getLocalPart())) {
currentParseable = new Parseable() {
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
switch (xmlEvent.getEventType()) {
@@ -178,7 +178,7 @@ public class DerivedKeyTokenType impleme
public void validate() throws ParseException {
}
};
- } else if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Length.getLocalPart())) {
+ } else if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Length.getLocalPart())) {
currentParseable = new Parseable() {
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
switch (xmlEvent.getEventType()) {
@@ -197,7 +197,7 @@ public class DerivedKeyTokenType impleme
public void validate() throws ParseException {
}
};
- } else if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Label.getLocalPart())) {
+ } else if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Label.getLocalPart())) {
currentParseable = new Parseable() {
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
switch (xmlEvent.getEventType()) {
@@ -216,7 +216,7 @@ public class DerivedKeyTokenType impleme
public void validate() throws ParseException {
}
};
- } else if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Nonce.getLocalPart())) {
+ } else if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Nonce.getLocalPart())) {
currentParseable = new Parseable() {
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
switch (xmlEvent.getEventType()) {
@@ -243,12 +243,12 @@ public class DerivedKeyTokenType impleme
case XMLStreamConstants.END_ELEMENT:
currentParseable = null;
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_DerivedKeyToken.getLocalPart())) {
+ if (endElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_DerivedKeyToken.getLocalPart())) {
return true;
}
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/PropertiesType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/PropertiesType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/PropertiesType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/PropertiesType.java Tue Oct 11 18:03:00 2011
@@ -20,8 +20,8 @@
package org.oasis_open.docs.ws_sx.ws_secureconversation._200512;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import org.w3c.dom.Element;
import javax.xml.bind.annotation.XmlAccessType;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/SecurityContextTokenType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/SecurityContextTokenType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/SecurityContextTokenType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/ws_sx/ws_secureconversation/_200512/SecurityContextTokenType.java Tue Oct 11 18:03:00 2011
@@ -20,10 +20,10 @@
package org.oasis_open.docs.ws_sx.ws_secureconversation._200512;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import org.w3c.dom.Element;
import javax.xml.bind.annotation.*;
@@ -91,7 +91,7 @@ public class SecurityContextTokenType im
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_wsu_Id)) {
+ if (attribute.getName().equals(WSSConstants.ATT_wsu_Id)) {
this.id = attribute.getValue();
}
}
@@ -111,7 +111,7 @@ public class SecurityContextTokenType im
case XMLStreamConstants.START_ELEMENT:
StartElement startElement = xmlEvent.asStartElement();
- if (startElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_Identifier.getLocalPart())) {
+ if (startElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_Identifier.getLocalPart())) {
currentParseable = new Parseable() {
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
switch (xmlEvent.getEventType()) {
@@ -138,12 +138,12 @@ public class SecurityContextTokenType im
case XMLStreamConstants.END_ELEMENT:
currentParseable = null;
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().getLocalPart().equals(Constants.TAG_wsc0502_SecurityContextToken.getLocalPart())) {
+ if (endElement.getName().getLocalPart().equals(WSSConstants.TAG_wsc0502_SecurityContextToken.getLocalPart())) {
return true;
}
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/AttributedString.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/AttributedString.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/AttributedString.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/AttributedString.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
@@ -87,7 +87,7 @@ public class AttributedString implements
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_wsu_Id)) {
+ if (attribute.getName().equals(WSSConstants.ATT_wsu_Id)) {
CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
}
@@ -109,7 +109,7 @@ public class AttributedString implements
this.value.append(xmlEvent.asCharacters().getData());
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/BinarySecurityTokenType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/BinarySecurityTokenType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/BinarySecurityTokenType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/BinarySecurityTokenType.java Tue Oct 11 18:03:00 2011
@@ -18,9 +18,9 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Utils;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
import javax.xml.bind.annotation.*;
import javax.xml.stream.XMLStreamConstants;
@@ -70,7 +70,7 @@ public class BinarySecurityTokenType
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_NULL_ValueType)) {
+ if (attribute.getName().equals(WSSConstants.ATT_NULL_ValueType)) {
this.valueType = attribute.getValue();
}
}
@@ -88,14 +88,14 @@ public class BinarySecurityTokenType
throw new ParseException("Unexpected Element: " + startElement.getName());
case XMLStreamConstants.END_ELEMENT:
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_wsse_BinarySecurityToken)) {
+ if (endElement.getName().equals(WSSConstants.TAG_wsse_BinarySecurityToken)) {
return true;
}
break;
case XMLStreamConstants.CHARACTERS:
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/EncodedString.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/EncodedString.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/EncodedString.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/EncodedString.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import javax.xml.bind.annotation.*;
import javax.xml.namespace.QName;
@@ -77,7 +77,7 @@ public class EncodedString
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_NULL_EncodingType)) {
+ if (attribute.getName().equals(WSSConstants.ATT_NULL_EncodingType)) {
this.encodingType = attribute.getValue();
}
}
@@ -99,7 +99,7 @@ public class EncodedString
case XMLStreamConstants.CHARACTERS:
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/KeyIdentifierType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/KeyIdentifierType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/KeyIdentifierType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/KeyIdentifierType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import javax.xml.bind.annotation.*;
import javax.xml.stream.XMLStreamConstants;
@@ -65,7 +65,7 @@ public class KeyIdentifierType
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_NULL_ValueType)) {
+ if (attribute.getName().equals(WSSConstants.ATT_NULL_ValueType)) {
this.valueType = attribute.getValue();
}
}
@@ -80,14 +80,14 @@ public class KeyIdentifierType
break;
case XMLStreamConstants.END_ELEMENT:
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_wsse_KeyIdentifier)) {
+ if (endElement.getName().equals(WSSConstants.TAG_wsse_KeyIdentifier)) {
return true;
}
break;
case XMLStreamConstants.CHARACTERS:
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/ReferenceType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/ReferenceType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/ReferenceType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/ReferenceType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,11 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import javax.xml.bind.annotation.*;
import javax.xml.namespace.QName;
@@ -79,9 +80,9 @@ public class ReferenceType implements Pa
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_NULL_URI)) {
- this.uri = Utils.dropReferenceMarker(attribute.getValue());
- } else if (attribute.getName().equals(Constants.ATT_NULL_ValueType)) {
+ if (attribute.getName().equals(WSSConstants.ATT_NULL_URI)) {
+ this.uri = WSSUtils.dropReferenceMarker(attribute.getValue());
+ } else if (attribute.getName().equals(WSSConstants.ATT_NULL_ValueType)) {
this.valueType = attribute.getValue();
}
}
@@ -99,7 +100,7 @@ public class ReferenceType implements Pa
switch (xmlEvent.getEventType()) {
case XMLStreamConstants.START_ELEMENT:
StartElement startElement = xmlEvent.asStartElement();
- if (startElement.getName().equals(Constants.TAG_wsse_BinarySecurityToken)) {
+ if (startElement.getName().equals(WSSConstants.TAG_wsse_BinarySecurityToken)) {
currentParseable = this.binarySecurityTokenType = new BinarySecurityTokenType(startElement);
} else {
throw new ParseException("Unexpected Element: " + startElement.getName());
@@ -108,12 +109,12 @@ public class ReferenceType implements Pa
case XMLStreamConstants.END_ELEMENT:
currentParseable = null;
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_wsse_Reference)) {
+ if (endElement.getName().equals(WSSConstants.TAG_wsse_Reference)) {
return true;
}
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/SecurityTokenReferenceType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/SecurityTokenReferenceType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/SecurityTokenReferenceType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/SecurityTokenReferenceType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,11 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import org.w3._2000._09.xmldsig_.X509DataType;
import org.w3c.dom.Element;
@@ -93,10 +94,10 @@ public class SecurityTokenReferenceType
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_wsu_Id)) {
+ if (attribute.getName().equals(WSSConstants.ATT_wsu_Id)) {
CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
- } else if (attribute.getName().equals(Constants.ATT_wsse_Usage)) {
+ } else if (attribute.getName().equals(WSSConstants.ATT_wsse_Usage)) {
this.getUsage().add(attribute.getValue());
}
}
@@ -116,11 +117,11 @@ public class SecurityTokenReferenceType
case XMLStreamConstants.START_ELEMENT:
StartElement startElement = xmlEvent.asStartElement();
- if (startElement.getName().equals(Constants.TAG_wsse_Reference)) {
+ if (startElement.getName().equals(WSSConstants.TAG_wsse_Reference)) {
currentParseable = this.referenceType = new ReferenceType(startElement);
- } else if (startElement.getName().equals(Constants.TAG_wsse_KeyIdentifier)) {
+ } else if (startElement.getName().equals(WSSConstants.TAG_wsse_KeyIdentifier)) {
currentParseable = this.keyIdentifierType = new KeyIdentifierType(startElement);
- } else if (startElement.getName().equals(Constants.TAG_dsig_X509Data)) {
+ } else if (startElement.getName().equals(WSSConstants.TAG_dsig_X509Data)) {
currentParseable = this.x509DataType = new X509DataType(startElement);
} else {
throw new ParseException("Unexpected Element: " + startElement.getName());
@@ -130,7 +131,7 @@ public class SecurityTokenReferenceType
case XMLStreamConstants.END_ELEMENT:
currentParseable = null;
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_wsse_SecurityTokenReference)) {
+ if (endElement.getName().equals(WSSConstants.TAG_wsse_SecurityTokenReference)) {
return true;
}
break;
@@ -139,7 +140,7 @@ public class SecurityTokenReferenceType
case XMLStreamConstants.COMMENT:
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/TransformationParametersType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/TransformationParametersType.java?rev=1181995&r1=1181994&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/TransformationParametersType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/oasis_open/docs/wss/_2004/_01/oasis_200401_wss_wssecurity_secext_1_0/TransformationParametersType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,11 @@
*/
package org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
import org.w3._2000._09.xmldsig_.CanonicalizationMethodType;
import org.w3c.dom.Element;
@@ -88,7 +89,7 @@ public class TransformationParametersTyp
switch (xmlEvent.getEventType()) {
case XMLStreamConstants.START_ELEMENT:
StartElement startElement = xmlEvent.asStartElement();
- if (startElement.getName().equals(Constants.TAG_dsig_CanonicalizationMethod)) {
+ if (startElement.getName().equals(WSSConstants.TAG_dsig_CanonicalizationMethod)) {
currentParseable = canonicalizationMethodType = new CanonicalizationMethodType(startElement);
} else {
throw new ParseException("Unsupported Element: " + startElement.getName());
@@ -97,7 +98,7 @@ public class TransformationParametersTyp
case XMLStreamConstants.END_ELEMENT:
currentParseable = null;
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_wsse_TransformationParameters)) {
+ if (endElement.getName().equals(WSSConstants.TAG_wsse_TransformationParameters)) {
return true;
}
break;
@@ -106,7 +107,7 @@ public class TransformationParametersTyp
case XMLStreamConstants.COMMENT:
break;
default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+ throw new ParseException("Unexpected event received " + WSSUtils.getXMLEventAsString(xmlEvent));
}
return false;
}