You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/09/12 11:23:26 UTC

svn commit: r442539 [1/4] - in /webservices/axis2/trunk/java/modules/security: src/META-INF/services/ src/org/apache/rampart/ src/org/apache/ws/security/policy/ src/org/apache/ws/security/policy1/ src/org/apache/ws/security/policy1/extension/ src/org/a...

Author: sanka
Date: Tue Sep 12 02:23:24 2006
New Revision: 442539

URL: http://svn.apache.org/viewvc?view=rev&rev=442539
Log:
Renaming the org.apache.ws.security.policy* package to org.apache.ws.security.policy1* since wss4j has a old version of that package. If those classes are loaded insteand of what you get in rampart then you are in trouble .. 

Added:
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/Constants.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfig.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfigBuilder.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSSPolicyException.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/extension/
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/extension/WSSCodegenPolicyExtension.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AbstractSecurityAssertion.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmSuite.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmWrapper.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AsymmetricBinding.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Binding.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/EncryptionToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Header.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/HttpsToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/InitiatorToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Layout.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/PolicyEngineData.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/ProtectionToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RecipientToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RootPolicyEngineData.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignatureToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignedEncryptedElements.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignedEncryptedParts.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SupportingToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SymmetricAsymmetricBindingBase.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SymmetricBinding.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Token.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/TokenWrapper.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/TransportBinding.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/TransportToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/UsernameToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Wss10.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Wss11.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/X509Token.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/SecurityPolicy.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/SecurityPolicyToken.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/SecurityProcessorContext.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/WSSPolicyProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/AlgorithmSuiteProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/AsymmetricBindingProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/EncryptedPartsElementsProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/EndorsingSupportingTokensProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/InitiatorRecipientTokenProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/LayoutProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/SignEncProtectTokenProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/SignedEndorsingSupportingTokensProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/SignedPartsElementsProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/SignedSupportingTokensProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/SupportingTokensProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/SymmetricBindingProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/TransportBindingProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/Trust10Processor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/UsernameTokenProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/Wss10Processor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/Wss11Processor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/parser/processors/X509TokenProcessor.java
    webservices/axis2/trunk/java/modules/security/test/org/apache/ws/security/policy1/
    webservices/axis2/trunk/java/modules/security/test/org/apache/ws/security/policy1/parser/
    webservices/axis2/trunk/java/modules/security/test/org/apache/ws/security/policy1/parser/WSSPolicyProcessorTest.java
Removed:
    webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy/
    webservices/axis2/trunk/java/modules/security/test/org/apache/ws/security/policy/
Modified:
    webservices/axis2/trunk/java/modules/security/src/META-INF/services/org.apache.neethi.builders.AssertionBuilder
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java

Modified: webservices/axis2/trunk/java/modules/security/src/META-INF/services/org.apache.neethi.builders.AssertionBuilder
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/META-INF/services/org.apache.neethi.builders.AssertionBuilder?view=diff&rev=442539&r1=442538&r2=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/META-INF/services/org.apache.neethi.builders.AssertionBuilder (original)
+++ webservices/axis2/trunk/java/modules/security/src/META-INF/services/org.apache.neethi.builders.AssertionBuilder Tue Sep 12 02:23:24 2006
@@ -1,2 +1,23 @@
+org.apache.ws.secpolicy.builders.AlgorithmSuiteBuilder
+org.apache.ws.secpolicy.builders.AsymmetricBindingBuilder
+org.apache.ws.secpolicy.builders.EncryptedElementsBuilder
+org.apache.ws.secpolicy.builders.EncryptedPartsBuilder
+org.apache.ws.secpolicy.builders.InitiatorTokenBuilder
+org.apache.ws.secpolicy.builders.LayoutBuilder
+org.apache.ws.secpolicy.builders.ProtectionTokenBuilder
+org.apache.ws.secpolicy.builders.RecipientTokenBuilder
+org.apache.ws.secpolicy.builders.SignedElementsBuilder
+org.apache.ws.secpolicy.builders.SignedPartsBuilder
+org.apache.ws.secpolicy.builders.SupportingTokensBuilder
+org.apache.ws.secpolicy.builders.TransportBindingBuilder
+org.apache.ws.secpolicy.builders.TransportTokenBuilder
+org.apache.ws.secpolicy.builders.UsernameTokenBuilder
+org.apache.ws.secpolicy.builders.WSS10Builder
+org.apache.ws.secpolicy.builders.WSS11Builder
+org.apache.ws.secpolicy.builders.X509TokenBuilder
+org.apache.ws.secpolicy.builders.Trust10Builder
+org.apache.ws.secpolicy.builders.SecurityContextTokenBuilder
+org.apache.ws.secpolicy.builders.SecureConversationTokenBuilder
+org.apache.ws.secpolicy.builders.SymmetricBindingBuilder
 org.apache.rampart.policy.builders.CryptoConfigBuilder
 org.apache.rampart.policy.builders.RampartConfigBuilder

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java?view=diff&rev=442539&r1=442538&r2=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java Tue Sep 12 02:23:24 2006
@@ -31,10 +31,10 @@
 import org.apache.rampart.handler.config.InflowConfiguration;
 import org.apache.rampart.handler.config.OutflowConfiguration;
 import org.apache.ws.policy.Policy;
-import org.apache.ws.security.policy.WSS4JConfig;
-import org.apache.ws.security.policy.WSS4JConfigBuilder;
-import org.apache.ws.security.policy.extension.WSSCodegenPolicyExtension;
-import org.apache.ws.security.policy.parser.WSSPolicyProcessor;
+import org.apache.ws.security.policy1.WSS4JConfig;
+import org.apache.ws.security.policy1.WSS4JConfigBuilder;
+import org.apache.ws.security.policy1.extension.WSSCodegenPolicyExtension;
+import org.apache.ws.security.policy1.parser.WSSPolicyProcessor;
 
 public class Rampart implements Module, ModulePolicyExtension  {
     private AxisModule module;

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/Constants.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/Constants.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/Constants.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1;
+
+public class Constants {
+
+    public final static String SP_NS = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";
+    
+    public final static String ATTR_INCLUDE_TOKEN = "IncludeToken";
+
+    public final static String INCLUDE_NEVER = Constants.SP_NS
+            + "/IncludeToken/Never";
+
+    public final static String INCLUDE_ONCE = Constants.SP_NS
+            + "/IncludeToken/Once";
+
+    public final static String INCLUDE_ALWAYS_TO_RECIPIENT = Constants.SP_NS
+            + "/IncludeToken/AlwaysToRecipient";
+
+    public final static String INCLUDE_ALWAYS = Constants.SP_NS
+            + "/IncludeToken/Always";
+
+    
+    public final static int SUPPORTING_TOKEN_SUPPORTING = 1;
+    public final static int SUPPORTING_TOKEN_ENDORSING = 2;
+    public final static int SUPPORTING_TOKEN_SIGNED = 3;
+    public final static int SUPPORTING_TOKEN_SIGNED_ENDORSING = 4;
+    
+    /**
+     * Security Header Layout : Strict
+     */
+    public final static String LAYOUT_STRICT = "Strict";
+
+    /**
+     * Security Header Layout : Lax
+     */
+    public final static String LAYOUT_LAX = "Lax";
+
+    /**
+     * Security Header Layout : LaxTimestampFirst
+     */
+    public final static String LAYOUT_LAX_TIMESTAMP_FIRST = "LaxTimestampFirst";
+
+    /**
+     * Security Header Layout : LaxTimestampLast
+     */
+    public final static String LAYOUT_LAX_TIMESTAMP_LAST = "LaxTimestampLast";
+    
+    /**
+     * Protection Order : EncryptBeforeSigning
+     */
+    public final static String ENCRYPT_BEFORE_SIGNING = "EncryptBeforeSigning";
+
+    /**
+     * Protection Order : SignBeforeEncrypting
+     */
+    public final static String SIGN_BEFORE_ENCRYPTING = "SignBeforeEncrypting";
+    
+    public final static String WSS_X509_V1_TOKEN10 = "WssX509V1Token10";
+    
+    public final static String WSS_X509_V3_TOKEN10 = "WssX509V3Token10";
+    
+    public final static String WSS_X509_PKCS7_TOKEN10 = "WssX509Pkcs7Token10";
+    
+    public final static String WSS_X509_PKI_PATH_V1_TOKEN10 = 
+                                                    "WssX509PkiPathV1Token10";
+    
+    public final static String WSS_X509_V1_TOKEN11 = "WssX509V1Token11";
+    
+    public final static String WSS_X509_V3_TOKEN11 = "WssX509V3Token11";
+    
+    public final static String WSS_X509_PKCS7_TOKEN11 = "WssX509Pkcs7Token11";
+    
+    public final static String WSS_X509_PKI_PATH_V1_TOKEN11 = 
+                                                    "WssX509PkiPathV1Token11";
+    
+    ///
+    ///Algorithm Suites
+    ///
+    public final static String ALGO_SUITE_BASIC256 = "Basic256";
+    public final static String ALGO_SUITE_BASIC192 = "Basic192";
+    public final static String ALGO_SUITE_BASIC128 = "Basic128";
+    public final static String ALGO_SUITE_TRIPLE_DES = "TripleDes";
+    public final static String ALGO_SUITE_BASIC256_RSA15 = "Basic256Rsa15";
+    public final static String ALGO_SUITE_BASIC192_RSA15 = "Basic192Rsa15";
+    public final static String ALGO_SUITE_BASIC128_RSA15 = "Basic128Rsa15";
+    public final static String ALGO_SUITE_TRIPLE_DES_RSA15 = "TripleDesRsa15";
+    public final static String ALGO_SUITE_BASIC256_SHA256 = "Basic256Sha256";
+    public final static String ALGO_SUITE_BASIC192_SHA256 = "Basic192Sha256";
+    public final static String ALGO_SUITE_BASIC128_SHA256 = "Basic128Sha256";
+    public final static String ALGO_SUITE_TRIPLE_DES_SHA256 = "TripleDesSha256";
+    public final static String ALGO_SUITE_BASIC256_SHA256_RSA15 = 
+                                                        "Basic256Sha256Rsa15";
+    public final static String ALGO_SUITE_BASIC192_SHA256_RSA15 = 
+                                                        "Basic192Sha256Rsa15";
+    public final static String ALGO_SUITE_BASIC128_SHA256_RSA15 = 
+                                                        "Basic128Sha256Rsa15";
+    public final static String ALGO_SUITE_TRIPLE_DES_SHA256_RSA15 = 
+                                                        "TripleDesSha256Rsa15";
+    
+    ///
+    ///Algorithms
+    ///
+    public final static String HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
+
+    public final static String RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
+
+    public final static String SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
+
+    public final static String SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
+
+    public final static String SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
+
+    public final static String AES128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
+
+    public final static String AES192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
+
+    public final static String AES256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
+
+    public final static String TRIPLE_DES = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
+
+    public final static String KW_AES128 = "http://www.w3.org/2001/04/xmlenc#kw-aes256";
+
+    public final static String KW_AES192 = "http://www.w3.org/2001/04/xmlenc#kw-aes192";
+
+    public final static String KW_AES256 = "http://www.w3.org/2001/04/xmlenc#kw-aes128";
+
+    public final static String KW_TRIPLE_DES = "http://www.w3.org/2001/04/xmlenc#kw-tripledes";
+
+    public final static String KW_RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
+
+    public final static String KW_RSA15 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
+
+    public final static String P_SHA1 = "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
+
+    public final static String P_SHA1_L128 = "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
+
+    public final static String P_SHA1_L192 = "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
+
+    public final static String P_SHA1_L256 = "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
+
+    public final static String XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116";
+
+    public final static String XPATH20 = "http://www.w3.org/2002/06/xmldsig-filter2";
+
+    public final static String C14N = "http://www.w3.org/2001/10/xml-c14n#";
+
+    public final static String EX_C14N = "http://www.w3.org/2001/10/xml-exc-c14n#";
+
+    public final static String SNT = "http://www.w3.org/TR/soap12-n11n";
+
+    public final static String STRT10 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform";
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfig.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfig.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfig.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfig.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1;
+
+import org.apache.rampart.handler.config.InflowConfiguration;
+import org.apache.rampart.handler.config.OutflowConfiguration;
+import org.apache.ws.security.policy1.model.Binding;
+import org.apache.ws.security.policy1.model.SupportingToken;
+
+public class WSS4JConfig {
+
+    private OutflowConfiguration outflowConfiguration = new OutflowConfiguration();
+    private InflowConfiguration inflowConfiguration = new InflowConfiguration();
+    
+    Binding binding;
+    
+    /**
+     * Right now we support one supporting token. E.g. Usernametoken
+     */
+    SupportingToken supportingToken;
+    
+    boolean signature;
+    boolean encryption;
+    
+    /**
+     * @return Returns the inflowConfiguration.
+     */
+    public InflowConfiguration getInflowConfiguration() {
+        return inflowConfiguration;
+    }
+//    /**
+//     * @param inflowConfiguration The inflowConfiguration to set.
+//     */
+//    public void setInflowConfiguration(InflowConfiguration inflowConfiguration) {
+//        this.inflowConfiguration = inflowConfiguration;
+//    }
+    /**
+     * @return Returns the outflowConfiguration.
+     */
+    public OutflowConfiguration getOutflowConfiguration() {
+        return outflowConfiguration;
+    }
+//    /**
+//     * @param outflowConfiguration The outflowConfiguration to set.
+//     */
+//    public void setOutflowConfiguration(OutflowConfiguration outflowConfiguration) {
+//        this.outflowConfiguration = outflowConfiguration;
+//    }
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfigBuilder.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfigBuilder.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSS4JConfigBuilder.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,273 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ws.security.policy1;
+
+import org.apache.rampart.handler.WSSHandlerConstants;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.policy1.model.AsymmetricBinding;
+import org.apache.ws.security.policy1.model.Binding;
+import org.apache.ws.security.policy1.model.Header;
+import org.apache.ws.security.policy1.model.PolicyEngineData;
+import org.apache.ws.security.policy1.model.SignedEncryptedParts;
+import org.apache.ws.security.policy1.model.SupportingToken;
+import org.apache.ws.security.policy1.model.SymmetricAsymmetricBindingBase;
+import org.apache.ws.security.policy1.model.Token;
+import org.apache.ws.security.policy1.model.TransportBinding;
+import org.apache.ws.security.policy1.model.UsernameToken;
+import org.apache.ws.security.policy1.model.Wss10;
+import org.apache.ws.security.policy1.model.Wss11;
+import org.apache.ws.security.policy1.model.X509Token;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class WSS4JConfigBuilder {
+    public static WSS4JConfig build(ArrayList topLevelPeds) throws WSSPolicyException {    
+	return build(topLevelPeds,true);
+   }
+
+    public static WSS4JConfig build(ArrayList topLevelPeds,boolean serverSide) throws WSSPolicyException {
+        Iterator topLevelPEDIterator = topLevelPeds.iterator();
+        WSS4JConfig config = new WSS4JConfig();
+        while (topLevelPEDIterator.hasNext()) {
+            PolicyEngineData ped = (PolicyEngineData) topLevelPEDIterator.next();
+            if(ped instanceof Binding) {
+                config.binding = (Binding)ped;
+            } if(ped instanceof SupportingToken) {
+                config.supportingToken = (SupportingToken)ped;
+            } else if(ped instanceof Wss10) {
+                processWSS10((Wss10)ped, config);
+            } else if(ped instanceof Wss11) {
+                processWSS11((Wss11)ped, config);
+            } else if (ped instanceof SignedEncryptedParts) {
+                processSignedEncryptedParts((SignedEncryptedParts)ped, config);
+            } else {
+              //Unrecognized token  
+            }
+        }
+        finalizeConfig(config,serverSide);
+        return config;
+    }
+
+    private static void finalizeConfig(WSS4JConfig config,boolean serverSide) throws WSSPolicyException{
+        
+        config.getInflowConfiguration().setEnableSignatureConfirmation(false);
+        config.getOutflowConfiguration().setEnableSignatureConfirmation(false);
+        
+        if(config.binding != null) {
+            if(config.binding instanceof TransportBinding) {
+                TransportBinding binding = (TransportBinding)config.binding;
+                if(binding.isIncludeTimestamp()) {
+                    config.getInflowConfiguration().setActionItems("Timestamp");
+                    config.getOutflowConfiguration().setActionItems("Timestamp");
+                }
+            } else {
+                //Handle common properties from SymmetricAsymmetricBindingBase
+                SymmetricAsymmetricBindingBase base = (SymmetricAsymmetricBindingBase) config.binding;
+                if(base.isEntireHeaderAndBodySignatures()) {
+                    config.getOutflowConfiguration().setSignAllHeadersAndBody();
+                }
+                if (base.isSignatureProtection()) {
+                    if (base.getProtectionOrder().equals(
+                            Constants.SIGN_BEFORE_ENCRYPTING)) {
+                        //Makesure encryption is on
+                        config.encryption = true;
+                        
+                        //Add a sign part pointing to the signature
+                        String encrParts = config.getOutflowConfiguration()
+                                .getEncryptionParts();
+                        boolean otherSignPartsExists = encrParts != null
+                                && encrParts.length() > 0;
+                        String part = getEncryptedPartSnippet(false, WSConstants.SIG_NS,
+                                WSConstants.SIG_LN, !otherSignPartsExists);
+                        if(otherSignPartsExists) {
+                            part = encrParts + part;
+                        }
+                        config.getOutflowConfiguration().setEncryptionParts(part);
+                    } else {
+                        throw new WSSPolicyException("To enable SignatureProtection" +
+                                " the ProtectionOrder must be SignBeforeEncrypting");
+                    }
+                }
+                if(base.isTokenProtection()) {
+                    throw new WSSPolicyException(
+                            "TokenProtection is not supported right now " +
+                            "since there's no way to specify how to sign " +
+                            "the token that is used to sign ???");
+                }
+                
+                //Start building action items
+                String actionItems = "";
+                if(config.signature && config.encryption) {
+                    if(base.getProtectionOrder().equals(Constants.SIGN_BEFORE_ENCRYPTING)) {
+                        actionItems = "Signature Encrypt";
+                    } else {
+                        actionItems = "Encrypt Signature";
+                    }
+                } else if(config.signature) {
+                    actionItems = " Signature";
+                } else if(config.encryption) {
+                    actionItems  = " Encrypt";
+                }
+                
+                if(base.isIncludeTimestamp()) {
+                    //TODO: Caution: including Timestamp as the starting action item  
+                    actionItems = " Timestamp " + actionItems;
+                    
+                }
+                if(actionItems.length() == 0) {
+                    actionItems = "NoSecurity";
+                }
+                config.getInflowConfiguration().setActionItems(actionItems.trim());
+                config.getOutflowConfiguration().setActionItems(actionItems.trim());
+            }
+    
+    
+	   if(config.binding instanceof AsymmetricBinding) {
+                if(serverSide){
+                    AsymmetricBinding asymmetricBinding = (AsymmetricBinding) config.binding;
+                    Token recipientToken = asymmetricBinding.getRecipientToken()
+                            .getReceipientToken();
+                    String initiatorInclusion = recipientToken.getInclusion();
+                    if (initiatorInclusion
+                            .equals(Constants.INCLUDE_ALWAYS_TO_RECIPIENT)
+                            || initiatorInclusion.equals(Constants.INCLUDE_ALWAYS)) {
+                        config.getOutflowConfiguration().setSignatureKeyIdentifier(
+                                WSSHandlerConstants.BST_DIRECT_REFERENCE);
+                    } else {
+                        if(recipientToken instanceof X509Token) {
+                            config.getOutflowConfiguration().setSignatureKeyIdentifier(
+                                    WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+                        }
+                    }
+                }else{
+                    AsymmetricBinding asymmetricBinding = (AsymmetricBinding) config.binding;
+                    Token initiatorToken = asymmetricBinding.getInitiatorToken().getInitiatorToken();
+                    String initiatorInclusion = initiatorToken.getInclusion();
+                    if (initiatorInclusion
+                            .equals(Constants.INCLUDE_ALWAYS_TO_RECIPIENT)
+                            || initiatorInclusion.equals(Constants.INCLUDE_ALWAYS)) {
+                        config.getOutflowConfiguration().setSignatureKeyIdentifier(
+                                WSSHandlerConstants.BST_DIRECT_REFERENCE);
+                    } else {
+                        if(initiatorToken instanceof X509Token) {
+                            config.getOutflowConfiguration().setSignatureKeyIdentifier(
+                                    WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+                        }
+                    }
+                }
+            } else {
+                //TODO Handle symmetric binding
+            }
+        }
+            
+        
+        
+        if(config.supportingToken != null) {
+            if(config.supportingToken.getType() == Constants.SUPPORTING_TOKEN_SUPPORTING || 
+                    config.supportingToken.getType() == Constants.SUPPORTING_TOKEN_SIGNED) {
+                ArrayList tokens = config.supportingToken.getTokens();
+                Iterator tokensIter = tokens.iterator();
+                while (tokensIter.hasNext()) {
+                    Token token = (Token) tokensIter.next();
+                    if(token instanceof UsernameToken) {
+                        String items = config.getInflowConfiguration().getActionItems();
+                        if(items == null || items.length() == 0) {
+                            if(serverSide) {
+                                config.getInflowConfiguration().setActionItems("UsernameToken");
+                            } else {
+                                config.getOutflowConfiguration().setActionItems("UsernameToken") ;
+                            }
+                        } else {
+                            items = "UsernameToken " + items;
+                            if(serverSide) {
+                                config.getInflowConfiguration().setActionItems(items);
+                            } else {
+                                config.getOutflowConfiguration().setActionItems(items);
+                            }
+                        }
+                    }
+                }
+            } else {
+                //TODO : support the other types of upporting tokens
+            }
+        }
+    }
+
+
+    private static void processWSS10(Wss10 wss10, WSS4JConfig config) {
+        //There's nothing to populate in WSS4J Config right now
+    }
+
+    private static void processWSS11(Wss11 wss11, WSS4JConfig config) {
+       if(wss11.isRequireSignatureConfirmation()) {
+           config.getInflowConfiguration().setEnableSignatureConfirmation(true);
+           config.getOutflowConfiguration().setEnableSignatureConfirmation(true);
+       }
+    }
+
+    private static void processSignedEncryptedParts(SignedEncryptedParts parts,
+            WSS4JConfig config) {
+        if(parts.isSignedParts()) {
+            config.signature = true;
+            if(parts.isBody()) {
+                config.getOutflowConfiguration().setSignBody();
+            }
+            Iterator headersIter = parts.getHeaders().iterator();
+            String signedParts = "";
+            while (headersIter.hasNext()) {
+                Header header = (Header) headersIter.next();
+                signedParts += getSignedPartSnippet(header.getNamespace(),
+                        header.getNamespace(), signedParts.length() == 0);
+            }
+            if(signedParts.length() != 0) {
+                config.getOutflowConfiguration().setSignatureParts(signedParts);
+            }
+        } else {
+            config.encryption = true;
+            if(parts.isBody()) {
+                config.getOutflowConfiguration().setEncryptBody();
+            }
+            Iterator headersIter = parts.getHeaders().iterator();
+            String encryptedParts = "";
+            while (headersIter.hasNext()) {
+                Header header = (Header) headersIter.next();
+                encryptedParts += getEncryptedPartSnippet(false, header
+                        .getNamespace(), header.getName(), encryptedParts
+                        .length() == 0);
+            }
+            if(encryptedParts.length() != 0) {
+                config.getOutflowConfiguration().setEncryptionParts(encryptedParts);
+            }
+        }
+    }
+
+    private static String getSignedPartSnippet(String namespace, String name,
+            boolean first) {
+        return first ? "{Element}{" + namespace + "}" + name : ";{Element}{"
+                + namespace + "}" + name;
+    }
+
+    private static String getEncryptedPartSnippet(boolean content,
+            String namespace, String name, boolean first) {
+        String ret = "";
+        if(!first) {
+            ret=";";
+        }
+        return content ? ret + "{}{" + namespace + "}" + name : ret
+                + "{Element}{" + namespace + "}" + name;
+    }
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSSPolicyException.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSSPolicyException.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSSPolicyException.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/WSSPolicyException.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1;
+
+public class WSSPolicyException extends Exception {
+
+    private static final long serialVersionUID = 5904800255533588133L;
+
+    public WSSPolicyException(String message, Throwable e) {
+        super(message, e);
+    }
+
+    public WSSPolicyException(String message) {
+        super(message);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/extension/WSSCodegenPolicyExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/extension/WSSCodegenPolicyExtension.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/extension/WSSCodegenPolicyExtension.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/extension/WSSCodegenPolicyExtension.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ws.security.policy1.extension;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.modules.PolicyExtension;
+import org.apache.rampart.handler.config.OutflowConfiguration;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.security.policy1.WSS4JConfig;
+import org.apache.ws.security.policy1.WSS4JConfigBuilder;
+import org.apache.ws.security.policy1.model.RootPolicyEngineData;
+import org.apache.ws.security.policy1.parser.WSSPolicyProcessor;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class WSSCodegenPolicyExtension implements PolicyExtension {
+
+    public void addMethodsToStub(Document document, Element element,
+            QName methodName, Policy policy) {
+        try {
+            WSSPolicyProcessor processor = new WSSPolicyProcessor();
+            processor.setup();
+            
+            if (!policy.isNormalized()) {
+                policy = (Policy) policy.normalize();
+            }
+            
+            processor.processPolicy(policy);
+                
+            RootPolicyEngineData data = processor.getRootPED();
+            
+            WSS4JConfig wss4jConfig = WSS4JConfigBuilder.build(data.getTopLevelPEDs(), false);
+            OutflowConfiguration outflowConfiguration = wss4jConfig.getOutflowConfiguration();
+            
+            Element secElement = document.createElement("security-codegen-policy-extensions");
+            
+            String actionItems = outflowConfiguration.getActionItems();
+            
+            if (actionItems != null) {
+                String[] actions = actionItems.split(" ");
+                
+                Element child;
+                String localname;
+                for (int i = 0; i < actions.length; i++) {
+                    localname = actions[i].toLowerCase() + "-action";
+                    child = document.createElement(localname);
+                    secElement.appendChild(child);
+                }
+            }
+            
+            element.appendChild(secElement);
+            
+        } catch (Exception nsme) {
+            throw new RuntimeException("error in WSSPolicyExtension " , nsme);
+            
+        }
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AbstractSecurityAssertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AbstractSecurityAssertion.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AbstractSecurityAssertion.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AbstractSecurityAssertion.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ws.security.policy1.model;
+
+import org.apache.neethi.Assertion;
+
+public abstract class AbstractSecurityAssertion implements Assertion{
+
+    private boolean isOptional;
+
+    public boolean isOptional() {
+        return isOptional;
+    }
+    
+    public void setOptional(boolean isOptional) {
+        this.isOptional = isOptional;
+    }
+
+    public short getType() {
+        return Assertion.ASSERTION;
+    }    
+
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmSuite.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmSuite.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmSuite.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,364 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.Constants;
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class AlgorithmSuite extends PolicyEngineData {
+    
+    private String symmetricSignature = Constants.HMAC_SHA1;
+    
+    private String asymmetricSignature = Constants.RSA_SHA1;
+
+    private String computedKey = Constants.P_SHA1;
+
+    private int maximumSymmetricKeyLength = 256;
+    
+    private int minimumAsymmetricKeyLength = 1024;
+    
+    private int maximumAsymmetricKeyLength = 4096;
+
+    private String digest;
+    
+    private String encryption;
+    
+    private String symmetricKeyWrap;
+    
+    private String asymmetricKeyWrap;
+    
+    private String encryptionKeyDerivation;
+    
+    private String signatureKeyDerivation;
+    
+    private int minimumSymmetricKeyLength;
+    
+    private String c14n = Constants.EX_C14N;
+    
+    private String soapNormalization;
+
+    private String strTransform;
+    
+    private String xPath;
+    
+//    public AlgorithmSuite (String algoSuite) throws WSSPolicyException {
+//        this.setAlgorithmSuite(algoSuite);
+//    }
+    
+    /**
+     * Set the algorithm suite
+     * @param algoSuite
+     * @throws WSSPolicyException
+     * @see Constants#ALGO_SUITE_BASIC128
+     * @see Constants#ALGO_SUITE_BASIC128_RSA15
+     * @see Constants#ALGO_SUITE_BASIC128_SHA256
+     * @see Constants#ALGO_SUITE_BASIC128_SHA256_RSA15
+     * @see Constants#ALGO_SUITE_BASIC192
+     * @see Constants#ALGO_SUITE_BASIC192_RSA15
+     * @see Constants#ALGO_SUITE_BASIC192_SHA256
+     * @see Constants#ALGO_SUITE_BASIC192_SHA256_RSA15
+     * @see Constants#ALGO_SUITE_BASIC256
+     * @see Constants#ALGO_SUITE_BASIC256_RSA15
+     * @see Constants#ALGO_SUITE_BASIC256_SHA256
+     * @see Constants#ALGO_SUITE_BASIC256_SHA256_RSA15
+     * @see Constants#ALGO_SUITE_TRIPLE_DES
+     * @see Constants#ALGO_SUITE_TRIPLE_DES_RSA15
+     * @see Constants#ALGO_SUITE_TRIPLE_DES_SHA256
+     * @see Constants#ALGO_SUITE_TRIPLE_DES_SHA256_RSA15
+     */
+    public void setAlgorithmSuite(String algoSuite) throws WSSPolicyException {
+        //TODO: Optimize this :-)
+        if(Constants.ALGO_SUITE_BASIC256.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.AES256;
+            this.symmetricKeyWrap = Constants.KW_AES256;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L256;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 256;
+        } else if (Constants.ALGO_SUITE_BASIC192.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.AES192;
+            this.symmetricKeyWrap = Constants.KW_AES192;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else if (Constants.ALGO_SUITE_BASIC128.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.AES128;
+            this.symmetricKeyWrap = Constants.KW_AES128;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L128;
+            this.signatureKeyDerivation = Constants.P_SHA1_L128;
+            this.minimumSymmetricKeyLength = 128;
+        } else if(Constants.ALGO_SUITE_TRIPLE_DES.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.TRIPLE_DES;
+            this.symmetricKeyWrap = Constants.KW_TRIPLE_DES;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else if (Constants.ALGO_SUITE_BASIC256_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.AES256;
+            this.symmetricKeyWrap = Constants.KW_AES256;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L256;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 256;
+        } else if (Constants.ALGO_SUITE_BASIC192_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.AES192;
+            this.symmetricKeyWrap = Constants.KW_AES192;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else if (Constants.ALGO_SUITE_BASIC128_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.AES128;
+            this.symmetricKeyWrap = Constants.KW_AES128;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L128;
+            this.signatureKeyDerivation = Constants.P_SHA1_L128;
+            this.minimumSymmetricKeyLength = 128;
+        } else if (Constants.ALGO_SUITE_TRIPLE_DES_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA1;
+            this.encryption = Constants.TRIPLE_DES;
+            this.symmetricKeyWrap = Constants.KW_TRIPLE_DES;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else if(Constants.ALGO_SUITE_BASIC256_SHA256.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.AES256;
+            this.symmetricKeyWrap = Constants.KW_AES256;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L256;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 256;
+        } else if (Constants.ALGO_SUITE_BASIC192_SHA256.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.AES192;
+            this.symmetricKeyWrap = Constants.KW_AES192;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else if (Constants.ALGO_SUITE_BASIC128_SHA256.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.AES128;
+            this.symmetricKeyWrap = Constants.KW_AES128;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L128;
+            this.signatureKeyDerivation = Constants.P_SHA1_L128;
+            this.minimumSymmetricKeyLength = 128;
+        } else if(Constants.ALGO_SUITE_TRIPLE_DES_SHA256.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.TRIPLE_DES;
+            this.symmetricKeyWrap = Constants.KW_TRIPLE_DES;
+            this.asymmetricKeyWrap = Constants.KW_RSA_OAEP;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        }  else if (Constants.ALGO_SUITE_BASIC256_SHA256_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.AES256;
+            this.symmetricKeyWrap = Constants.KW_AES256;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L256;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 256;
+        } else if (Constants.ALGO_SUITE_BASIC192_SHA256_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.AES192;
+            this.symmetricKeyWrap = Constants.KW_AES192;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else if (Constants.ALGO_SUITE_BASIC128_SHA256_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.AES128;
+            this.symmetricKeyWrap = Constants.KW_AES128;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L128;
+            this.signatureKeyDerivation = Constants.P_SHA1_L128;
+            this.minimumSymmetricKeyLength = 128;
+        } else if (Constants.ALGO_SUITE_TRIPLE_DES_SHA256_RSA15.equals(algoSuite)) {
+            this.digest = Constants.SHA256;
+            this.encryption = Constants.TRIPLE_DES;
+            this.symmetricKeyWrap = Constants.KW_TRIPLE_DES;
+            this.asymmetricKeyWrap = Constants.KW_RSA15;
+            this.encryptionKeyDerivation = Constants.P_SHA1_L192;
+            this.signatureKeyDerivation = Constants.P_SHA1_L192;
+            this.minimumSymmetricKeyLength = 192;
+        } else {
+            throw new WSSPolicyException("Invalid algorithm suite : " + algoSuite);
+        }
+    }
+
+    /**
+     * @return Returns the asymmetricKeyWrap.
+     */
+    public String getAsymmetricKeyWrap() {
+        return asymmetricKeyWrap;
+    }
+
+    /**
+     * @return Returns the asymmetricSignature.
+     */
+    public String getAsymmetricSignature() {
+        return asymmetricSignature;
+    }
+
+    /**
+     * @return Returns the computedKey.
+     */
+    public String getComputedKey() {
+        return computedKey;
+    }
+
+    /**
+     * @return Returns the digest.
+     */
+    public String getDigest() {
+        return digest;
+    }
+
+    /**
+     * @return Returns the encryption.
+     */
+    public String getEncryption() {
+        return encryption;
+    }
+
+    /**
+     * @return Returns the encryptionKeyDerivation.
+     */
+    public String getEncryptionKeyDerivation() {
+        return encryptionKeyDerivation;
+    }
+
+    /**
+     * @return Returns the maximumAsymmetricKeyLength.
+     */
+    public int getMaximumAsymmetricKeyLength() {
+        return maximumAsymmetricKeyLength;
+    }
+
+    /**
+     * @return Returns the maximumSymmetricKeyLength.
+     */
+    public int getMaximumSymmetricKeyLength() {
+        return maximumSymmetricKeyLength;
+    }
+
+    /**
+     * @return Returns the minimumAsymmetricKeyLength.
+     */
+    public int getMinimumAsymmetricKeyLength() {
+        return minimumAsymmetricKeyLength;
+    }
+
+    /**
+     * @return Returns the minimumSymmetricKeyLength.
+     */
+    public int getMinimumSymmetricKeyLength() {
+        return minimumSymmetricKeyLength;
+    }
+
+    /**
+     * @return Returns the signatureKeyDerivation.
+     */
+    public String getSignatureKeyDerivation() {
+        return signatureKeyDerivation;
+    }
+
+    /**
+     * @return Returns the symmetricKeyWrap.
+     */
+    public String getSymmetricKeyWrap() {
+        return symmetricKeyWrap;
+    }
+
+    /**
+     * @return Returns the symmetricSignature.
+     */
+    public String getSymmetricSignature() {
+        return symmetricSignature;
+    }
+
+    /**
+     * @return Returns the c14n.
+     */
+    public String getInclusiveC14n() {
+        return c14n;
+    }
+
+    /**
+     * @param c14n The c14n to set.
+     */
+    public void setC14n(String c14n) throws WSSPolicyException {
+            this.c14n = c14n;
+    }
+
+    /**
+     * @return Returns the soapNormalization.
+     */
+    public String getSoapNormalization() {
+        return soapNormalization;
+    }
+
+    /**
+     * @param soapNormalization The soapNormalization to set.
+     */
+    public void setSoapNormalization(String soapNormalization) throws WSSPolicyException {
+            this.soapNormalization = soapNormalization;
+    }
+
+    /**
+     * @return Returns the strTransform.
+     */
+    public String getStrTransform() {
+        return strTransform;
+    }
+
+    /**
+     * @param strTransform The strTransform to set.
+     */
+    public void setStrTransform(String strTransform) throws WSSPolicyException {
+            this.strTransform = strTransform;
+    }
+
+    /**
+     * @return Returns the xPath.
+     */
+    public String getXPath() {
+        return xPath;
+    }
+
+    /**
+     * @param path The xPath to set.
+     */
+    public void setXPath(String path) throws WSSPolicyException{
+        xPath = path;
+    }
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmWrapper.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmWrapper.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AlgorithmWrapper.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public interface AlgorithmWrapper {
+
+    public void setAlgorithmSuite(AlgorithmSuite algorithmSuite) throws WSSPolicyException;
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AsymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AsymmetricBinding.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AsymmetricBinding.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/AsymmetricBinding.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+public class AsymmetricBinding extends SymmetricAsymmetricBindingBase {
+    
+    private InitiatorToken initiatorToken;
+    
+    private RecipientToken recipientToken;
+    
+    /**
+     * @return Returns the initiatorToken.
+     */
+    public InitiatorToken getInitiatorToken() {
+        return initiatorToken;
+    }
+    /**
+     * @param initiatorToken The initiatorToken to set.
+     */
+    public void setInitiatorToken(InitiatorToken initiatorToken) {
+        this.initiatorToken = initiatorToken;
+    }
+    /**
+     * @return Returns the recipientToken.
+     */
+    public RecipientToken getRecipientToken() {
+        return recipientToken;
+    }
+    /**
+     * @param recipientToken The recipientToken to set.
+     */
+    public void setRecipientToken(RecipientToken recipientToken) {
+        this.recipientToken = recipientToken;
+    }
+    
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Binding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Binding.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Binding.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Binding.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class Binding extends PolicyEngineData implements AlgorithmWrapper {
+
+    private AlgorithmSuite algorithmSuite;
+    private boolean includeTimestamp;
+    private Layout layout = new Layout();
+    
+    /**
+     * @return Returns the algorithmSuite.
+     */
+    public AlgorithmSuite getAlgorithmSuite() {
+        return algorithmSuite;
+    }
+
+    /**
+     * @param algorithmSuite The algorithmSuite to set.
+     */
+    public void setAlgorithmSuite(AlgorithmSuite algorithmSuite) {
+        this.algorithmSuite = algorithmSuite;
+    }
+
+    /**
+     * @return Returns the includeTimestamp.
+     */
+    public boolean isIncludeTimestamp() {
+        return includeTimestamp;
+    }
+
+    /**
+     * @param includeTimestamp The includeTimestamp to set.
+     */
+    public void setIncludeTimestamp(boolean includeTimestamp) {
+        this.includeTimestamp = includeTimestamp;
+    }
+    
+    /**
+     * @return Returns the layout.
+     */
+    public Layout getLayout() {
+        return layout;
+    }
+
+    /**
+     * @param layout The layout to set.
+     */
+    public void setLayout(Layout layout) throws WSSPolicyException {
+        this.layout = layout;
+    }
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/EncryptionToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/EncryptionToken.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/EncryptionToken.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/EncryptionToken.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class EncryptionToken extends PolicyEngineData implements TokenWrapper {
+
+    private Token encryptionToken;
+
+    /**
+     * @return Returns the encryptionToken.
+     */
+    public Token getEncryptionToken() {
+        return encryptionToken;
+    }
+
+    /**
+     * @param encryptionToken The encryptionToken to set.
+     */
+    public void setEncryptionToken(Token encryptionToken) {
+        this.encryptionToken = encryptionToken;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ws.security.policy.TokenWrapper#setToken(org.apache.ws.security.policy.Token)
+     */
+    public void setToken(Token tok) throws WSSPolicyException {
+        this.setEncryptionToken(tok);
+    }
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Header.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Header.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Header.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Header.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+public class Header extends PolicyEngineData {
+
+    private String name;
+    private String namespace;
+    
+    /**
+     * @return Returns the name.
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+    /**
+     * @return Returns the namespace.
+     */
+    public String getNamespace() {
+        return namespace;
+    }
+    /**
+     * @param namespace The namespace to set.
+     */
+    public void setNamespace(String namespace) {
+        this.namespace = namespace;
+    }
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/HttpsToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/HttpsToken.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/HttpsToken.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/HttpsToken.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+/**
+ *
+ * @author Ruchith Fernando (ruchith.fernando@gmail.com)
+ */
+public class HttpsToken extends PolicyEngineData {
+
+    private Token httpsToken;
+
+    /**
+     * @return Returns the httpsToken.
+     */
+    public Token getHttpsToken() {
+        return httpsToken;
+    }
+
+    /**
+     * @param httpsToken The httpsToken to set.
+     */
+    public void setHttpsToken(Token httpsToken) {
+        this.httpsToken = httpsToken;
+    }
+    
+
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/InitiatorToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/InitiatorToken.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/InitiatorToken.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/InitiatorToken.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class InitiatorToken extends PolicyEngineData implements TokenWrapper {
+    
+    private Token initiatorToken;
+
+    /**
+     * @return Returns the initiatorToken.
+     */
+    public Token getInitiatorToken() {
+        return initiatorToken;
+    }
+
+    /**
+     * @param initiatorToken The initiatorToken to set.
+     */
+    public void setInitiatorToken(Token initiatorToken) {
+        this.initiatorToken = initiatorToken;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ws.security.policy.TokenWrapper#setToken(org.apache.ws.security.policy.Token)
+     */
+    public void setToken(Token tok) throws WSSPolicyException {
+        this.setInitiatorToken(tok);
+    }
+    
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Layout.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Layout.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Layout.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/Layout.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.Constants;
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class Layout extends PolicyEngineData {
+   
+    private String value = Constants.LAYOUT_LAX;
+
+    /**
+     * @return Returns the value.
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * @param value The value to set.
+     */
+    public void setValue(String value) throws WSSPolicyException{
+        if(Constants.LAYOUT_LAX.equals(value) ||
+                Constants.LAYOUT_STRICT.equals(value) ||
+                Constants.LAYOUT_LAX_TIMESTAMP_FIRST.equals(value) ||
+                Constants.LAYOUT_LAX_TIMESTAMP_LAST.equals(value)) {
+                 this.value = value;
+             } else {
+                 throw new WSSPolicyException("Incorrect layout value : " + value);
+             }
+    }
+    
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/PolicyEngineData.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/PolicyEngineData.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/PolicyEngineData.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/PolicyEngineData.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.security.policy1.Constants;
+import org.apache.ws.security.policy1.WSSPolicyException;
+import org.apache.ws.security.policy1.parser.SecurityPolicy;
+
+import javax.xml.namespace.QName;
+
+public class PolicyEngineData {
+
+	private static final Log log = LogFactory.getLog(PolicyEngineData.class);
+    
+    public void initializeWithDefaults() {
+        
+    }
+    
+    public static  PolicyEngineData copy(QName name) throws WSSPolicyException {
+        String localPart = name.getLocalPart();
+        if(localPart.equals(SecurityPolicy.symmetricBinding.getTokenName())) {
+            return new SymmetricBinding();
+        } else if (localPart.equals(SecurityPolicy.asymmetricBinding.getTokenName())) {
+            return new AsymmetricBinding();
+        } else if (localPart.equals(SecurityPolicy.transportBinding.getTokenName())) {
+            return new TransportBinding();
+        } else if (localPart.equals(SecurityPolicy.algorithmSuite.getTokenName())) {
+            return new AlgorithmSuite();
+        } else if (localPart.equals(SecurityPolicy.signedElements.getTokenName())) {
+            return new SignedEncryptedElements(true);
+        } else if (localPart.equals(SecurityPolicy.encryptedElements.getTokenName())) {
+            return new SignedEncryptedElements(false);
+        } else if (localPart.equals(SecurityPolicy.signedParts.getTokenName())) {
+            return new SignedEncryptedParts(true);
+        } else if (localPart.equals(SecurityPolicy.encryptedParts.getTokenName())) {
+            return new SignedEncryptedParts(false);
+        } else if (localPart.equals(SecurityPolicy.header.getTokenName())) {
+            return new Header();
+        } else if (localPart.equals(SecurityPolicy.protectionToken.getTokenName())) {
+            return new ProtectionToken();
+        } else if (localPart.equals(SecurityPolicy.signatureToken.getTokenName())) {
+            return new SignatureToken();
+        } else if (localPart.equals(SecurityPolicy.encryptionToken.getTokenName())) {
+            return new EncryptionToken();
+        } else if (localPart.equals(SecurityPolicy.x509Token.getTokenName())) {
+            return new X509Token();
+        } else if (localPart.equals(SecurityPolicy.layout.getTokenName())) {
+            return new Layout();
+        } else if (localPart.equals(SecurityPolicy.signedSupportingTokens.getTokenName())) {
+            return new SupportingToken(Constants.SUPPORTING_TOKEN_SIGNED);
+        } else if (localPart.equals(SecurityPolicy.signedEndorsingSupportingTokens.getTokenName())) {
+            return new SupportingToken(Constants.SUPPORTING_TOKEN_SIGNED_ENDORSING);
+        } else if (localPart.equals(SecurityPolicy.supportingTokens.getTokenName())) {
+            return new SupportingToken(Constants.SUPPORTING_TOKEN_SUPPORTING);
+        } else if (localPart.equals(SecurityPolicy.endorsingSupportingTokens.getTokenName())) {
+            return new SupportingToken(Constants.SUPPORTING_TOKEN_ENDORSING);
+        } else if (localPart.equals(SecurityPolicy.usernameToken.getTokenName())) {
+            return new UsernameToken();
+        } else if (localPart.equals(SecurityPolicy.wss10.getTokenName())) {
+            return new Wss10();
+        } else if (localPart.equals(SecurityPolicy.wss11.getTokenName())) {
+            return new Wss11();
+        } else if (localPart.equals(SecurityPolicy.initiatorToken.getTokenName())) {
+            return new InitiatorToken();
+        } else if (localPart.equals(SecurityPolicy.recipientToken.getTokenName())) {
+            return new RecipientToken();
+        } else if (localPart.equals(SecurityPolicy.transportToken.getTokenName())) {
+            return new TransportToken();
+        } else if (localPart.equals(SecurityPolicy.httpsToken.getTokenName())) {
+            return new HttpsToken();
+        } else {
+            log.error("Unsuppotred: " + localPart);
+            throw new WSSPolicyException("Unsuppotred complex assertion :" + localPart);
+        }
+    }
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/ProtectionToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/ProtectionToken.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/ProtectionToken.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/ProtectionToken.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class ProtectionToken extends PolicyEngineData implements TokenWrapper {
+    
+    private Token protectionToken;
+
+    /**
+     * @return Returns the protectionToken.
+     */
+    public Token getProtectionToken() {
+        return protectionToken;
+    }
+
+    /**
+     * @param protectionToken The protectionToken to set.
+     */
+    public void setProtectionToken(Token protectionToken) {
+        this.protectionToken = protectionToken;
+    }
+
+    public void setToken(Token tok) throws WSSPolicyException {
+        this.setProtectionToken(tok);
+    }
+    
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RecipientToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RecipientToken.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RecipientToken.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RecipientToken.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class RecipientToken extends PolicyEngineData implements TokenWrapper {
+    
+    private Token receipientToken;
+
+    /**
+     * @return Returns the receipientToken.
+     */
+    public Token getReceipientToken() {
+        return receipientToken;
+    }
+
+    /**
+     * @param receipientToken The receipientToken to set.
+     */
+    public void setReceipientToken(Token receipientToken) {
+        this.receipientToken = receipientToken;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ws.security.policy.TokenWrapper#setToken(org.apache.ws.security.policy.Token)
+     */
+    public void setToken(Token tok) throws WSSPolicyException {
+        this.setReceipientToken(tok);
+    }
+    
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RootPolicyEngineData.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RootPolicyEngineData.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RootPolicyEngineData.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/RootPolicyEngineData.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import java.util.ArrayList;
+
+public class RootPolicyEngineData extends PolicyEngineData {
+
+    private ArrayList topLevelPEDs = new ArrayList();
+    
+    public void addTopLevelPED(PolicyEngineData ped) {
+        if(!topLevelPEDs.contains(ped)) {
+            this.topLevelPEDs.add(ped);
+        }
+    }
+    
+    public ArrayList getTopLevelPEDs() {
+        return this.topLevelPEDs;
+    }
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignatureToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignatureToken.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignatureToken.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignatureToken.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import org.apache.ws.security.policy1.WSSPolicyException;
+
+public class SignatureToken extends PolicyEngineData implements TokenWrapper {
+
+    private Token signatureToken;
+
+    /**
+     * @return Returns the signatureToken.
+     */
+    public Token getSignatureToken() {
+        return signatureToken;
+    }
+
+    /**
+     * @param signatureToken The signatureToken to set.
+     */
+    public void setSignatureToken(Token signatureToken) {
+        this.signatureToken = signatureToken;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ws.security.policy.TokenWrapper#setToken(org.apache.ws.security.policy.Token)
+     */
+    public void setToken(Token tok) throws WSSPolicyException {
+        this.setSignatureToken(tok);
+    }
+    
+    
+}

Added: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignedEncryptedElements.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignedEncryptedElements.java?view=auto&rev=442539
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignedEncryptedElements.java (added)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy1/model/SignedEncryptedElements.java Tue Sep 12 02:23:24 2006
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.security.policy1.model;
+
+import java.util.ArrayList;
+
+public class SignedEncryptedElements extends PolicyEngineData {
+
+    private ArrayList xPathExpressions = new ArrayList();
+    private String xPathVersion;
+    
+    /**
+     * Just a flag to identify whether this holds 
+     * sign element info or encr elements info 
+     */
+    private boolean signedElemets;
+    
+    public SignedEncryptedElements(boolean signedElements) {
+        this.signedElemets = signedElements;
+    }
+    
+    /**
+     * @return Returns the xPathExpressions.
+     */
+    public ArrayList getXPathExpressions() {
+        return xPathExpressions;
+    }
+
+    public void addXPathExpression(String expr) {
+        this.xPathExpressions.add(expr);
+    }
+
+    /**
+     * @return Returns the xPathVersion.
+     */
+    public String getXPathVersion() {
+        return xPathVersion;
+    }
+
+    /**
+     * @param pathVersion The xPathVersion to set.
+     */
+    public void setXPathVersion(String pathVersion) {
+        xPathVersion = pathVersion;
+    }
+
+    /**
+     * @return Returns the signedElemets.
+     */
+    public boolean isSignedElemets() {
+        return signedElemets;
+    }
+    
+    
+    
+}



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