axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r448527 - in /webservices/axis2/trunk/java/modules/security: test-resources/policy/rampart-asymm-binding-5-ebs.xml test/org/apache/rampart/AsymmetricBindingBuilderTest.java test/org/apache/rampart/TransportBindingBuilderTest.java
Date Thu, 21 Sep 2006 12:13:54 GMT
Author: ruchithf
Date: Thu Sep 21 05:13:53 2006
New Revision: 448527

URL: http://svn.apache.org/viewvc?view=rev&rev=448527
Log:
Added a test for asymm binding - encrypt before sig

Added:
    webservices/axis2/trunk/java/modules/security/test-resources/policy/rampart-asymm-binding-5-ebs.xml
Modified:
    webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/AsymmetricBindingBuilderTest.java
    webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/TransportBindingBuilderTest.java

Added: webservices/axis2/trunk/java/modules/security/test-resources/policy/rampart-asymm-binding-5-ebs.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/test-resources/policy/rampart-asymm-binding-5-ebs.xml?view=auto&rev=448527
==============================================================================
--- webservices/axis2/trunk/java/modules/security/test-resources/policy/rampart-asymm-binding-5-ebs.xml
(added)
+++ webservices/axis2/trunk/java/modules/security/test-resources/policy/rampart-asymm-binding-5-ebs.xml
Thu Sep 21 05:13:53 2006
@@ -0,0 +1,76 @@
+<wsp:Policy  wsu:Id="6" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:InitiatorToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:InitiatorToken>
+					<sp:RecipientToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:RecipientToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256/>
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+					<sp:Layout>
+						<wsp:Policy>
+							<sp:Lax/>
+						</wsp:Policy>
+					</sp:Layout>
+					<sp:EncryptBeforeSigning />
+					<sp:IncludeTimestamp/>
+					<sp:OnlySignEntireHeadersAndBody/>
+				</wsp:Policy>
+			</sp:AsymmetricBinding>
+			<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:MustSupportRefKeyIdentifier/>
+					<sp:MustSupportRefIssuerSerial/>
+				</wsp:Policy>
+			</sp:Wss10>
+			<sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:MustSupportIssuedTokens/>
+					<sp:RequireClientEntropy/>
+					<sp:RequireServerEntropy/>
+				</wsp:Policy>
+			</sp:Trust10>
+			
+			<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
+				<ramp:user>alice</ramp:user>
+				<ramp:encryptionUser>bob</ramp:encryptionUser>
+				<ramp:passwordCallbackClass>org.apache.rampart.TestCBHandler</ramp:passwordCallbackClass>
+				
+				<ramp:signatureCrypto>
+					<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.file">interop/interop2.jks</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+					</ramp:crypto>
+				</ramp:signatureCrypto>
+				<ramp:encryptionCypto>
+					<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.file">interop/interop2.jks</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+					</ramp:crypto>
+				</ramp:encryptionCypto>
+			</ramp:RampartConfig>
+	
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>

Modified: webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/AsymmetricBindingBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/AsymmetricBindingBuilderTest.java?view=diff&rev=448527&r1=448526&r2=448527
==============================================================================
--- webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/AsymmetricBindingBuilderTest.java
(original)
+++ webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/AsymmetricBindingBuilderTest.java
Thu Sep 21 05:13:53 2006
@@ -19,10 +19,6 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.neethi.Policy;
 
-/**
- *
- * @author Ruchith Fernando (ruchith.fernando@gmail.com)
- */
 public class AsymmetricBindingBuilderTest extends MessageBuilderTestBase {
     
     public void testAsymmBinding() {
@@ -121,4 +117,23 @@
         }
     }
     
+    
+    public void testAsymmBindingEncrBeforeSig() {
+        try {
+            MessageContext ctx = getMsgCtx();
+            
+            String policyXml = "test-resources/policy/rampart-asymm-binding-5-ebs.xml";
+            Policy policy = this.loadPolicy(policyXml);
+            
+            ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
+            
+            MessageBuilder builder = new MessageBuilder();
+            builder.build(ctx);
+            
+            System.out.println(ctx.getEnvelope());
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail(e.getMessage());
+        }
+    }
 }

Modified: webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/TransportBindingBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/TransportBindingBuilderTest.java?view=diff&rev=448527&r1=448526&r2=448527
==============================================================================
--- webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/TransportBindingBuilderTest.java
(original)
+++ webservices/axis2/trunk/java/modules/security/test/org/apache/rampart/TransportBindingBuilderTest.java
Thu Sep 21 05:13:53 2006
@@ -19,10 +19,6 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.neethi.Policy;
 
-/**
- *
- * @author Ruchith Fernando (ruchith.fernando@gmail.com)
- */
 public class TransportBindingBuilderTest extends MessageBuilderTestBase {
 
     public void testTransportBinding() {
@@ -103,4 +99,5 @@
             fail(e.getMessage());
         }
     }
+    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message