You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by sa...@apache.org on 2006/08/08 13:24:20 UTC
svn commit: r429632 [1/2] - in /webservices/commons/trunk/modules/neethi: ./
examples/wsse/src/org/apache/ws/security/policy/builders/
examples/wsse/src/org/apache/ws/security/policy/model/
Author: sanka
Date: Tue Aug 8 04:24:18 2006
New Revision: 429632
URL: http://svn.apache.org/viewvc?rev=429632&view=rev
Log:
Adding Security Policy assertion builders as an example code
Added:
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AbstractSecurityAssertion.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmSuite.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmWrapper.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AsymmetricBinding.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Binding.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/EncryptionToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Header.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/HttpsToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/InitiatorToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Layout.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/ProtectionToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/RecipientToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignatureToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedElements.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedParts.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SupportingToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricAsymmetricBindingBase.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricBinding.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Token.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TokenWrapper.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportBinding.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/UsernameToken.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss10.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss11.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/X509Token.java
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/test.java
Modified:
webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/builders/AsymmetricBindingBuilder.java
webservices/commons/trunk/modules/neethi/maven.xml
Modified: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/builders/AsymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/builders/AsymmetricBindingBuilder.java?rev=429632&r1=429631&r2=429632&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/builders/AsymmetricBindingBuilder.java (original)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/builders/AsymmetricBindingBuilder.java Tue Aug 8 04:24:18 2006
@@ -23,6 +23,7 @@
public class AsymmetricBindingBuilder implements AssertionBuilder {
public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
+ return null;
}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AbstractSecurityAssertion.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AbstractSecurityAssertion.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AbstractSecurityAssertion.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AbstractSecurityAssertion.java Tue Aug 8 04:24:18 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.policy.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/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmSuite.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmSuite.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmSuite.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,395 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class AlgorithmSuite extends AbstractSecurityAssertion {
+
+ 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;
+
+ private List algorithmSuites;
+
+// 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) {
+ //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) {
+ this.c14n = c14n;
+ }
+
+ /**
+ * @return Returns the soapNormalization.
+ */
+ public String getSoapNormalization() {
+ return soapNormalization;
+ }
+
+ /**
+ * @param soapNormalization The soapNormalization to set.
+ */
+ public void setSoapNormalization(String soapNormalization) {
+ this.soapNormalization = soapNormalization;
+ }
+
+ /**
+ * @return Returns the strTransform.
+ */
+ public String getStrTransform() {
+ return strTransform;
+ }
+
+ /**
+ * @param strTransform The strTransform to set.
+ */
+ public void setStrTransform(String strTransform) {
+ this.strTransform = strTransform;
+ }
+
+ /**
+ * @return Returns the xPath.
+ */
+ public String getXPath() {
+ return xPath;
+ }
+
+ /**
+ * @param path The xPath to set.
+ */
+ public void setXPath(String path) {
+ xPath = path;
+ }
+
+ public List getOptions() {
+ return algorithmSuites;
+ }
+
+ public void addOption(AlgorithmSuite algorithmSuite) {
+ if (algorithmSuites == null) {
+ algorithmSuites = new ArrayList();
+ }
+ algorithmSuites.add(algorithmSuite);
+ }
+
+ public QName getName() {
+ return Constants.ALGORITHM_SUITE;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmWrapper.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmWrapper.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AlgorithmWrapper.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,23 @@
+/*
+ * 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.policy.model;
+
+public interface AlgorithmWrapper {
+
+ public void setAlgorithmSuite(AlgorithmSuite algorithmSuite);
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AsymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AsymmetricBinding.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AsymmetricBinding.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/AsymmetricBinding.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,82 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class AsymmetricBinding extends SymmetricAsymmetricBindingBase {
+
+ private InitiatorToken initiatorToken;
+
+ private RecipientToken recipientToken;
+
+ private List asymmetricBindings = new ArrayList();
+
+ /**
+ * @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;
+ }
+
+ public Iterator getOptions() {
+ return asymmetricBindings.iterator();
+ }
+
+ public void addOption(AsymmetricBinding asymmetricBinding) {
+ asymmetricBindings.add(asymmetricBinding);
+ }
+ public QName getName() {
+ return Constants.ASYMMETRIC_BINDING;
+ }
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Binding.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Binding.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Binding.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Binding.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,89 @@
+/*
+ * 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.policy.model;
+
+public abstract class Binding extends AbstractSecurityAssertion implements AlgorithmWrapper {
+
+ private AlgorithmSuite algorithmSuite;
+ private boolean includeTimestamp;
+ private Layout layout = new Layout();
+ private SupportingToken signedSupportingToken;
+ private SupportingToken signedEndorsingSupportingTokens;
+
+ /**
+ * @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) {
+ this.layout = layout;
+ }
+
+ public SupportingToken getSignedEndorsingSupportingTokens() {
+ return signedEndorsingSupportingTokens;
+ }
+
+ public void setSignedEndorsingSupportingTokens(
+ SupportingToken signedEndorsingSupportingTokens) {
+ this.signedEndorsingSupportingTokens = signedEndorsingSupportingTokens;
+ }
+
+ public SupportingToken getSignedSupportingToken() {
+ return signedSupportingToken;
+ }
+
+ public void setSignedSupportingToken(SupportingToken signedSupportingToken) {
+ this.signedSupportingToken = signedSupportingToken;
+ }
+
+
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/EncryptionToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/EncryptionToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/EncryptionToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/EncryptionToken.java Tue Aug 8 04:24:18 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.policy.model;
+
+public class EncryptionToken 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) {
+ this.setEncryptionToken(tok);
+ }
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Header.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Header.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Header.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Header.java Tue Aug 8 04:24:18 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.policy.model;
+
+public class Header {
+
+ 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/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/HttpsToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/HttpsToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/HttpsToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/HttpsToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,76 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+/**
+ *
+ * @author Ruchith Fernando (ruchith.fernando@gmail.com)
+ */
+public class HttpsToken extends Token {
+
+ private Token httpsToken;
+
+ private List httpsTokens = new ArrayList();
+
+ /**
+ * @return Returns the httpsToken.
+ */
+ public Token getHttpsToken() {
+ return httpsToken;
+ }
+
+ /**
+ * @param httpsToken The httpsToken to set.
+ */
+ public void setHttpsToken(Token httpsToken) {
+ this.httpsToken = httpsToken;
+ }
+
+ public Iterator getOptions() {
+ return httpsTokens.iterator();
+ }
+
+ public void addOption(HttpsToken httpsToken) {
+ httpsTokens.add(httpsToken);
+ }
+
+ public QName getName() {
+ return Constants.HTTPS_TOKEN;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/InitiatorToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/InitiatorToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/InitiatorToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/InitiatorToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,45 @@
+/*
+ * 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.policy.model;
+
+public class InitiatorToken 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) {
+ this.setInitiatorToken(tok);
+ }
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Layout.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Layout.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Layout.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Layout.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,78 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class Layout extends AbstractSecurityAssertion {
+
+ private String value = Constants.LAYOUT_LAX;
+
+ private List layouts;
+
+ /**
+ * @return Returns the value.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value The value to set.
+ */
+ public void setValue(String value) {
+ 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);
+ }
+ }
+
+ public List getOptions() {
+ return layouts;
+ }
+
+ public void addOption(Layout layout) {
+ if (layouts == null) {
+ layouts = new ArrayList();
+ }
+ layouts.add(layout);
+ }
+
+ public QName getName() {
+ return Constants.LAYOUT;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/ProtectionToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/ProtectionToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/ProtectionToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/ProtectionToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,77 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class ProtectionToken extends AbstractSecurityAssertion implements TokenWrapper {
+
+ private Token protectionToken;
+
+ private List protectionTokens = new ArrayList();
+
+ /**
+ * @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) {
+ this.setProtectionToken(tok);
+ }
+
+ public Iterator getOptions() {
+ return protectionTokens.iterator();
+ }
+
+ public void addOption(ProtectionToken protectionToken) {
+ protectionTokens.add(protectionToken);
+ }
+
+ public QName getName() {
+ return Constants.PROTECTION_TOKEN;
+ }
+
+ public PolicyComponent normalize() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/RecipientToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/RecipientToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/RecipientToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/RecipientToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,45 @@
+/*
+ * 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.policy.model;
+
+public class RecipientToken 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) {
+ this.setReceipientToken(tok);
+ }
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignatureToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignatureToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignatureToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignatureToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,45 @@
+/*
+ * 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.policy.model;
+
+public class SignatureToken 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) {
+ this.setSignatureToken(tok);
+ }
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedElements.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedElements.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedElements.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedElements.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,93 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class SignedEncryptedElements extends AbstractSecurityAssertion {
+
+ 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;
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+
+ }
+
+ public QName getName() {
+ if (signedElemets) {
+ return Constants.SIGNED_ELEMENTS;
+ }
+ return Constants.ENCRYPTED_ELEMENTS;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedParts.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedParts.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedParts.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SignedEncryptedParts.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,89 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class SignedEncryptedParts extends AbstractSecurityAssertion {
+
+ private boolean body;
+
+ private ArrayList headers = new ArrayList();
+
+ private boolean signedParts;
+
+ public SignedEncryptedParts(boolean signedParts) {
+ this.signedParts = signedParts;
+ }
+
+ /**
+ * @return Returns the body.
+ */
+ public boolean isBody() {
+ return body;
+ }
+
+ /**
+ * @param body The body to set.
+ */
+ public void setBody(boolean body) {
+ this.body = body;
+ }
+
+ /**
+ * @return Returns the headers.
+ */
+ public ArrayList getHeaders() {
+ return this.headers;
+ }
+
+ /**
+ * @param headers The headers to set.
+ */
+ public void addHeader(Header header) {
+ this.headers.add(header);
+ }
+
+ /**
+ * @return Returns the signedParts.
+ */
+ public boolean isSignedParts() {
+ return signedParts;
+ }
+
+ public QName getName() {
+ if (signedParts) {
+ return Constants.SIGNED_PARTS;
+ }
+ return Constants.ENCRYPTED_PARTS;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SupportingToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SupportingToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SupportingToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SupportingToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,215 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.Assertion;
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class SupportingToken implements AlgorithmWrapper, TokenWrapper,
+ Assertion {
+
+ /**
+ * Type of SupportingToken
+ *
+ * @see SupportingToken#SUPPORTING
+ * @see SupportingToken#ENDORSING
+ * @see SupportingToken#SIGNED
+ * @see SupportingToken#SIGNED_ENDORSING
+ */
+ private int type;
+
+ private AlgorithmSuite algorithmSuite;
+
+ private ArrayList tokens = new ArrayList();
+
+ private SignedEncryptedElements signedElements;
+
+ private SignedEncryptedElements encryptedElements;
+
+ private SignedEncryptedParts signedParts;
+
+ private SignedEncryptedParts encryptedParts;
+
+ private ArrayList SupportingTokens = new ArrayList();
+
+ public SupportingToken(int type) {
+ this.type = type;
+ }
+
+ /**
+ * @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 token.
+ */
+ public ArrayList getTokens() {
+ return tokens;
+ }
+
+ /**
+ * @param token
+ * The token to set.
+ */
+ public void addToken(Token token) {
+ this.tokens.add(token);
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public int getTokenType() {
+ return type;
+ }
+
+ /**
+ * @param type
+ * The type to set.
+ */
+ public void setTokenType(int type) {
+ this.type = type;
+ }
+
+ /**
+ * @return Returns the encryptedElements.
+ */
+ public SignedEncryptedElements getEncryptedElements() {
+ return encryptedElements;
+ }
+
+ /**
+ * @param encryptedElements
+ * The encryptedElements to set.
+ */
+ public void setEncryptedElements(SignedEncryptedElements encryptedElements) {
+ this.encryptedElements = encryptedElements;
+ }
+
+ /**
+ * @return Returns the encryptedParts.
+ */
+ public SignedEncryptedParts getEncryptedParts() {
+ return encryptedParts;
+ }
+
+ /**
+ * @param encryptedParts
+ * The encryptedParts to set.
+ */
+ public void setEncryptedParts(SignedEncryptedParts encryptedParts) {
+ this.encryptedParts = encryptedParts;
+ }
+
+ /**
+ * @return Returns the signedElements.
+ */
+ public SignedEncryptedElements getSignedElements() {
+ return signedElements;
+ }
+
+ /**
+ * @param signedElements
+ * The signedElements to set.
+ */
+ public void setSignedElements(SignedEncryptedElements signedElements) {
+ this.signedElements = signedElements;
+ }
+
+ /**
+ * @return Returns the signedParts.
+ */
+ public SignedEncryptedParts getSignedParts() {
+ return signedParts;
+ }
+
+ /**
+ * @param signedParts
+ * The signedParts to set.
+ */
+ public void setSignedParts(SignedEncryptedParts signedParts) {
+ this.signedParts = signedParts;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.ws.security.policy.TokenWrapper#setToken(org.apache.ws.security.policy.Token)
+ */
+ public void setToken(Token tok) {
+ this.addToken(tok);
+ }
+
+ public QName getName() {
+ switch (type) {
+ case Constants.SUPPORTING_TOKEN_SIGNED:
+ return Constants.SIGNED_SUPPORTING_TOKENS;
+ case Constants.SUPPORTING_TOKEN_ENDORSING:
+ return Constants.ENDORSING_SUPPORTING_TOKENS;
+ case Constants.SUPPORTING_TOKEN_SIGNED_ENDORSING:
+ return Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS;
+ default:
+ return null;
+ }
+ }
+
+ public boolean isOptional() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public PolicyComponent normalize() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public short getType() {
+ return Assertion.ASSERTION;
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addOption(SupportingToken supportingToken) {
+ this.SupportingTokens.add(supportingToken);
+ }
+
+ public Iterator getOptions() {
+ return this.SupportingTokens.iterator();
+ }
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricAsymmetricBindingBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricAsymmetricBindingBase.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricAsymmetricBindingBase.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricAsymmetricBindingBase.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,96 @@
+/*
+ * 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.policy.model;
+
+import org.apache.ws.security.policy.Constants;
+
+public abstract class SymmetricAsymmetricBindingBase extends Binding {
+
+ private String protectionOrder = Constants.SIGN_BEFORE_ENCRYPTING;
+
+ private boolean signatureProtection;
+
+ private boolean tokenProtection;
+
+ private boolean entireHeaderAndBodySignatures;
+
+ /**
+ * @return Returns the entireHeaderAndBodySignatures.
+ */
+ public boolean isEntireHeaderAndBodySignatures() {
+ return entireHeaderAndBodySignatures;
+ }
+
+ /**
+ * @param entireHeaderAndBodySignatures The entireHeaderAndBodySignatures to set.
+ */
+ public void setEntireHeaderAndBodySignatures(
+ boolean entireHeaderAndBodySignatures) {
+ this.entireHeaderAndBodySignatures = entireHeaderAndBodySignatures;
+ }
+
+ /**
+ * @return Returns the protectionOrder.
+ */
+ public String getProtectionOrder() {
+ return protectionOrder;
+ }
+
+ /**
+ * @param protectionOrder The protectionOrder to set.
+ */
+ public void setProtectionOrder(String protectionOrder) {
+ if(Constants.ENCRYPT_BEFORE_SIGNING.equals(protectionOrder) ||
+ Constants.SIGN_BEFORE_ENCRYPTING.equals(protectionOrder)) {
+ this.protectionOrder = protectionOrder;
+ } else {
+// throw new WSSPolicyException("Incorrect protection order value : "
+// + protectionOrder);
+ }
+ }
+
+ /**
+ * @return Returns the signatureProtection.
+ */
+ public boolean isSignatureProtection() {
+ return signatureProtection;
+ }
+
+ /**
+ * @param signatureProtection The signatureProtection to set.
+ */
+ public void setSignatureProtection(boolean signatureProtection) {
+ this.signatureProtection = signatureProtection;
+ }
+
+ /**
+ * @return Returns the tokenProtection.
+ */
+ public boolean isTokenProtection() {
+ return tokenProtection;
+ }
+
+ /**
+ * @param tokenProtection The tokenProtection to set.
+ */
+ public void setTokenProtection(boolean tokenProtection) {
+ this.tokenProtection = tokenProtection;
+ }
+
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricBinding.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricBinding.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/SymmetricBinding.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,118 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+
+public class SymmetricBinding extends SymmetricAsymmetricBindingBase {
+
+ private EncryptionToken encryptionToken;
+
+ private SignatureToken signatureToken;
+
+ private ProtectionToken protectionToken;
+
+ private List symmetricBindings = new ArrayList();
+
+ /**
+ * @return Returns the encryptionToken.
+ */
+ public EncryptionToken getEncryptionToken() {
+ return encryptionToken;
+ }
+
+ /**
+ * @param encryptionToken The encryptionToken to set.
+ */
+ public void setEncryptionToken(EncryptionToken encryptionToken) {
+ if(this.protectionToken != null) {
+// throw new WSSPolicyException("Cannot use an EncryptionToken in a " +
+// "SymmetricBinding when there is a ProtectionToken");
+ }
+ this.encryptionToken = encryptionToken;
+ }
+
+ /**
+ * @return Returns the protectionToken.
+ */
+ public ProtectionToken getProtectionToken() {
+ return protectionToken;
+ }
+
+ /**
+ * @param protectionToken The protectionToken to set.
+ */
+ public void setProtectionToken(ProtectionToken protectionToken) {
+ if(this.encryptionToken != null || this.signatureToken != null) {
+// throw new WSSPolicyException("Cannot use a ProtectionToken in a " +
+// "SymmetricBinding when there is a SignatureToken or an" +
+// "EncryptionToken");
+ }
+ this.protectionToken = protectionToken;
+ }
+
+ /**
+ * @return Returns the signatureToken.
+ */
+ public SignatureToken getSignatureToken() {
+ return signatureToken;
+ }
+
+ /**
+ * @param signatureToken The signatureToken to set.
+ */
+ public void setSignatureToken(SignatureToken signatureToken) {
+ if(this.protectionToken != null) {
+// throw new WSSPolicyException("Cannot use a SignatureToken in a " +
+// "SymmetricBinding when there is a ProtectionToken");
+ }
+ this.signatureToken = signatureToken;
+ }
+
+ public Iterator getOptions() {
+ return symmetricBindings.iterator();
+ }
+
+ public void addOption(SymmetricBinding symmetricBinding) {
+ symmetricBindings.add(symmetricBinding);
+ }
+
+ public QName getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public PolicyComponent normalize() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Token.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Token.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Token.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Token.java Tue Aug 8 04:24:18 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.policy.model;
+
+import org.apache.ws.security.policy.Constants;
+
+public abstract class Token extends AbstractSecurityAssertion {
+
+ /**
+ * Inclusiong property of a TokenAssertion
+ */
+ private String inclusion = Constants.INCLUDE_ALWAYS;
+
+ /**
+ * Whether to derive keys or not
+ */
+ private boolean derivedKeys;
+
+ /**
+ * @return Returns the inclusion.
+ */
+ public String getInclusion() {
+ return inclusion;
+ }
+
+ /**
+ * @param inclusion The inclusion to set.
+ */
+ public void setInclusion(String inclusion) {
+ if(Constants.INCLUDE_ALWAYS.equals(inclusion) ||
+ Constants.INCLUDE_ALWAYS_TO_RECIPIENT.equals(inclusion) ||
+ Constants.INCLUDE_NEVER.equals(inclusion) ||
+ Constants.INCLUDE_ONCE.equals(inclusion)) {
+ this.inclusion = inclusion;
+ } else {
+// throw new WSSPolicyException("Incorrect inclusion value: " + inclusion);
+ }
+ }
+
+ /**
+ * @return Returns the derivedKeys.
+ */
+ public boolean isDerivedKeys() {
+ return derivedKeys;
+ }
+
+ /**
+ * @param derivedKeys The derivedKeys to set.
+ */
+ public void setDerivedKeys(boolean derivedKeys) {
+ this.derivedKeys = derivedKeys;
+ }
+
+}
\ No newline at end of file
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TokenWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TokenWrapper.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TokenWrapper.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TokenWrapper.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,22 @@
+/*
+ * 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.policy.model;
+
+public interface TokenWrapper {
+
+ public void setToken(Token tok);
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportBinding.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportBinding.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportBinding.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportBinding.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,72 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class TransportBinding extends Binding {
+
+ private TransportToken transportToken;
+
+ private List transportBindings;
+
+ /**
+ * @return Returns the transportToken.
+ */
+ public TransportToken getTransportToken() {
+ return transportToken;
+ }
+
+ /**
+ * @param transportToken The transportToken to set.
+ */
+ public void setTransportToken(TransportToken transportToken) {
+ this.transportToken = transportToken;
+ }
+
+ public List getOptions() {
+ return transportBindings;
+ }
+
+ public void addOption(TransportBinding transportBinding) {
+ if (transportBindings == null) {
+ transportBindings = new ArrayList();
+ }
+ transportBindings.add(transportBinding);
+ }
+
+ public QName getName() {
+ return Constants.TRANSPORT_BINDING;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/TransportToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,83 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.Assertion;
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+
+public class TransportToken implements Assertion {
+
+ private Token transportToken;
+
+ private ArrayList transportTokens = new ArrayList();
+
+ /**
+ * @return Returns the transportToken.
+ */
+ public Token getTransportToken() {
+ return transportToken;
+ }
+
+ /**
+ * @param transportToken The transportToken to set.
+ */
+ public void setTransportToken(Token transportToken) {
+ this.transportToken = transportToken;
+ }
+
+ public Iterator getOptions() {
+ return transportTokens.iterator();
+ }
+
+ public void addOption(TransportToken transportToken) {
+ transportTokens.add(transportToken);
+ }
+
+ public QName getName() {
+ return new QName(Constants.SP_NS, "TransportToken");
+ }
+
+ public boolean isOptional() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public PolicyComponent normalize() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public short getType() {
+ return Assertion.ASSERTION;
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/UsernameToken.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/UsernameToken.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/UsernameToken.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,71 @@
+/*
+ * 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.policy.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.policy.Constants;
+
+public class UsernameToken extends Token {
+
+ private List usernameTokens;
+
+ private boolean useUTProfile11;
+
+ /**
+ * @return Returns the useUTProfile11.
+ */
+ public boolean isUseUTProfile11() {
+ return useUTProfile11;
+ }
+
+ /**
+ * @param useUTProfile11 The useUTProfile11 to set.
+ */
+ public void setUseUTProfile11(boolean useUTProfile11) {
+ this.useUTProfile11 = useUTProfile11;
+ }
+
+ public List getOptions() {
+ return usernameTokens;
+ }
+
+ public void addOption(UsernameToken usernameToken) {
+ if (usernameTokens == null) {
+ usernameTokens= new ArrayList();
+ }
+ usernameTokens.add(usernameToken);
+ }
+
+ public QName getName() {
+ return Constants.USERNAME_TOKEN;
+ }
+
+ public PolicyComponent normalize() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss10.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss10.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss10.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss10.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,75 @@
+/*
+ * 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.policy.model;
+
+public class Wss10 {
+
+ private boolean mustSupportRefKeyIdentifier;
+ private boolean MustSupportRefIssuerSerial;
+ private boolean MustSupportRefExternalURI;
+ private boolean MustSupportRefEmbeddedToken;
+
+ /**
+ * @return Returns the mustSupportRefEmbeddedToken.
+ */
+ public boolean isMustSupportRefEmbeddedToken() {
+ return MustSupportRefEmbeddedToken;
+ }
+ /**
+ * @param mustSupportRefEmbeddedToken The mustSupportRefEmbeddedToken to set.
+ */
+ public void setMustSupportRefEmbeddedToken(boolean mustSupportRefEmbeddedToken) {
+ MustSupportRefEmbeddedToken = mustSupportRefEmbeddedToken;
+ }
+ /**
+ * @return Returns the mustSupportRefExternalURI.
+ */
+ public boolean isMustSupportRefExternalURI() {
+ return MustSupportRefExternalURI;
+ }
+ /**
+ * @param mustSupportRefExternalURI The mustSupportRefExternalURI to set.
+ */
+ public void setMustSupportRefExternalURI(boolean mustSupportRefExternalURI) {
+ MustSupportRefExternalURI = mustSupportRefExternalURI;
+ }
+ /**
+ * @return Returns the mustSupportRefIssuerSerial.
+ */
+ public boolean isMustSupportRefIssuerSerial() {
+ return MustSupportRefIssuerSerial;
+ }
+ /**
+ * @param mustSupportRefIssuerSerial The mustSupportRefIssuerSerial to set.
+ */
+ public void setMustSupportRefIssuerSerial(boolean mustSupportRefIssuerSerial) {
+ MustSupportRefIssuerSerial = mustSupportRefIssuerSerial;
+ }
+ /**
+ * @return Returns the mustSupportRefKeyIdentifier.
+ */
+ public boolean isMustSupportRefKeyIdentifier() {
+ return mustSupportRefKeyIdentifier;
+ }
+ /**
+ * @param mustSupportRefKeyIdentifier The mustSupportRefKeyIdentifier to set.
+ */
+ public void setMustSupportRefKeyIdentifier(boolean mustSupportRefKeyIdentifier) {
+ this.mustSupportRefKeyIdentifier = mustSupportRefKeyIdentifier;
+ }
+
+}
Added: webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss11.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss11.java?rev=429632&view=auto
==============================================================================
--- webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss11.java (added)
+++ webservices/commons/trunk/modules/neethi/examples/wsse/src/org/apache/ws/security/policy/model/Wss11.java Tue Aug 8 04:24:18 2006
@@ -0,0 +1,63 @@
+/*
+ * 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.policy.model;
+
+public class Wss11 extends Wss10 {
+
+ private boolean MustSupportRefThumbprint;
+ private boolean MustSupportRefEncryptedKey;
+ private boolean RequireSignatureConfirmation;
+
+ /**
+ * @return Returns the mustSupportRefEncryptedKey.
+ */
+ public boolean isMustSupportRefEncryptedKey() {
+ return MustSupportRefEncryptedKey;
+ }
+ /**
+ * @param mustSupportRefEncryptedKey The mustSupportRefEncryptedKey to set.
+ */
+ public void setMustSupportRefEncryptedKey(boolean mustSupportRefEncryptedKey) {
+ MustSupportRefEncryptedKey = mustSupportRefEncryptedKey;
+ }
+ /**
+ * @return Returns the mustSupportRefThumbprint.
+ */
+ public boolean isMustSupportRefThumbprint() {
+ return MustSupportRefThumbprint;
+ }
+ /**
+ * @param mustSupportRefThumbprint The mustSupportRefThumbprint to set.
+ */
+ public void setMustSupportRefThumbprint(boolean mustSupportRefThumbprint) {
+ MustSupportRefThumbprint = mustSupportRefThumbprint;
+ }
+ /**
+ * @return Returns the requireSignatureConfirmation.
+ */
+ public boolean isRequireSignatureConfirmation() {
+ return RequireSignatureConfirmation;
+ }
+ /**
+ * @param requireSignatureConfirmation The requireSignatureConfirmation to set.
+ */
+ public void setRequireSignatureConfirmation(boolean requireSignatureConfirmation) {
+ RequireSignatureConfirmation = requireSignatureConfirmation;
+ }
+
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org