You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by ru...@apache.org on 2005/10/30 16:10:50 UTC
svn commit: r329581 - in
/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security:
policy/message/token/ trust/ trust/message/token/
Author: ruchithf
Date: Sun Oct 30 07:10:14 2005
New Revision: 329581
URL: http://svn.apache.org/viewcvs?rev=329581&view=rev
Log:
Completed serialization/deserialization of the WS-Trust 'request' message elements including Request, Renew, Validate and Cancel
Modified:
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/policy/message/token/AppliesTo.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/RSTRParser.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/AllowPostdating.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/CancelTarget.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Code.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/ComputedKey.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Reason.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewRequestSecurityToken.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewTarget.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Renewing.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestSecurityTokenResponse.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestType.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java
webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Status.java
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/policy/message/token/AppliesTo.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/policy/message/token/AppliesTo.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/policy/message/token/AppliesTo.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/policy/message/token/AppliesTo.java Sun Oct 30 07:10:14 2005
@@ -16,22 +16,22 @@
*/
package org.apache.ws.sandbox.security.policy.message.token;
-import javax.xml.namespace.QName;
-
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
-import org.apache.ws.sandbox.security.trust.message.token.AbstractToken;
+import org.apache.ws.sandbox.security.trust.message.token.CompositeElement;
+import org.apache.ws.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
/**
* @author Malinda Kaushalye
* @author Ruchith Fernando
*/
-public class AppliesTo extends AbstractToken {
+public class AppliesTo extends CompositeElement {
public static final QName TOKEN = new QName(TrustConstants.WSP_NS, TrustConstants.APPLIESTO_LN, TrustConstants.WSP_PREFIX);
@@ -143,11 +143,4 @@
}
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
- // No processing required here xince everything is handled in the
- // deserializeChildElement
- }
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/RSTRParser.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/RSTRParser.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/RSTRParser.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/RSTRParser.java Sun Oct 30 07:10:14 2005
@@ -17,7 +17,6 @@
package org.apache.ws.sandbox.security.trust;
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.sandbox.security.policy.message.token.AppliesTo;
import org.apache.ws.sandbox.security.trust.message.token.BinarySecret;
import org.apache.ws.sandbox.security.trust.message.token.ComputedKey;
@@ -26,6 +25,7 @@
import org.apache.ws.sandbox.security.trust.message.token.RequestedProofToken;
import org.apache.ws.sandbox.security.trust.message.token.RequestedSecurityToken;
import org.apache.ws.sandbox.security.trust2.Lifetime;
+import org.apache.ws.security.WSSecurityException;
import org.apache.xml.utils.QName;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -126,7 +126,7 @@
//TODO: proofTok.s
Node val = elem.getChildNodes().item(0);
if (val.getNodeType() == Node.TEXT_NODE) {
- ckey.setComputedKeyValue(val.getNodeValue());
+ ckey.setValue(val.getNodeValue());
} else {
throw new WSTrustException("Parser Exception");
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/AllowPostdating.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/AllowPostdating.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/AllowPostdating.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/AllowPostdating.java Sun Oct 30 07:10:14 2005
@@ -32,7 +32,7 @@
* AllowPostdating element <p/>This element indicates
* that returned tokens should allow requests for postdated tokens.
*/
-public class AllowPostdating extends ValueElement {
+public class AllowPostdating extends AbstractToken {
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.ALLOWPOSTDATING_LN, TrustConstants.WST_PREFIX);
@@ -69,6 +69,11 @@
protected void setElementTextValue(Text textNode) throws WSTrustException{
throw new WSTrustException(WSTrustException.INVALID_REQUEST,
"There cannot be a value in this element");
+ }
+
+ protected void deserializeChildElement(Element elem) throws WSTrustException {
+ throw new WSTrustException(WSTrustException.INVALID_REQUEST,
+ "There cannot be a value in this element");
}
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/CancelTarget.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/CancelTarget.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/CancelTarget.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/CancelTarget.java Sun Oct 30 07:10:14 2005
@@ -16,21 +16,21 @@
*/
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.message.token.SecurityTokenReference;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.message.token.SecurityTokenReference;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
/**
* The <code>wst:CancelTarget</code> element
* @author Ruchith Fernando (ruchith.fernando@gmail.com)
*/
-public class CancelTarget extends AbstractToken {
+public class CancelTarget extends CompositeElement {
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.CANCEL_TARGET_LN, TrustConstants.WST_PREFIX);
@@ -120,16 +120,18 @@
/* (non-Javadoc)
* @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
*/
- protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
+ protected void deserializeChildElement(Element elem) throws WSTrustException {
+ QName el = new QName(elem.getNamespaceURI(), elem.getLocalName());
- }
-
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
- // TODO Auto-generated method stub
+ if(el.equals(new QName(WSConstants.WSSE_NS,SecurityTokenReference.SECURITY_TOKEN_REFERENCE)) && this.targetToken == null) {
+ try {
+ this.securityTokenReference = new SecurityTokenReference(elem);
+ } catch (WSSecurityException wsse) {
+ throw new WSTrustException(wsse.getMessage(),wsse);
+ }
+ } else if(this.securityTokenReference == null) {
+ this.targetToken = elem;
+ }
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Code.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Code.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Code.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Code.java Sun Oct 30 07:10:14 2005
@@ -16,14 +16,13 @@
*/
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
+import org.apache.ws.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
/**
* @author Malinda
@@ -31,11 +30,9 @@
* Code token
* @see org.apache.ws.sandbox.security.trust.message.token.Status
*/
-public class Code extends AbstractToken {
+public class Code extends ValueElement {
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.CODE_LN, TrustConstants.WST_PREFIX);
-
- private Text valueText;
/**
* Constructor for Code
@@ -67,30 +64,6 @@
this.valueText = doc.createTextNode(value);
this.element.appendChild(this.valueText);
}
-
- /**
- * Sets the Text node
- *
- * @param val
- */
- public void setValue(String val) {
- if(this.valueText != null)
- this.element.removeChild(this.valueText);
-
- this.valueText = this.element.getOwnerDocument().createTextNode(val);
- this.element.appendChild(this.valueText);
- }
-
- /**
- * @return value of the Code element
- */
- public String getValue() {
- if(this.valueText != null)
- return this.valueText.getNodeValue();
- else
- return null;
- }
-
/**
* Returns the QName of this type
@@ -98,22 +71,6 @@
*/
protected QName getToken() {
return TOKEN;
- }
-
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
- */
- protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
- // TODO Auto-generated method stub
-
}
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/ComputedKey.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/ComputedKey.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/ComputedKey.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/ComputedKey.java Sun Oct 30 07:10:14 2005
@@ -17,24 +17,21 @@
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
/**
* @author Dimuthu Leelarathne. (muthulee@yahoo.com)
* @author Ruchith Fernando
*/
-public class ComputedKey extends AbstractToken {
+public class ComputedKey extends ValueElement {
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.COMPUTED_KEY_LN, TrustConstants.WST_PREFIX);
-
- private Text valueText;
-
+
/**
* Constructor.
* <p/>
@@ -56,31 +53,6 @@
super(doc);
}
- /**
- * Sets the text node
- *
- * @param val
- */
- public void setComputedKeyValue(String val) {
- if(this.valueText != null)
- this.element.removeChild(this.valueText);
-
- this.valueText = element.getOwnerDocument().createTextNode(val);
- this.element.appendChild(this.valueText);
- }
-
- /**
- * return the value of the text node
- *
- * @return
- */
- public String getComputedKeyValue() {
- if(this.valueText != null)
- return this.valueText.getNodeValue();
- else
- return null;
- }
-
/**
* Returns the QName of this type
* @see org.apache.ws.sandbox.security.trust.message.token.AbstractToken#getToken()
@@ -89,20 +61,5 @@
return TOKEN;
}
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
- */
- protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
- // TODO Auto-generated method stub
-
- }
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Reason.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Reason.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Reason.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Reason.java Sun Oct 30 07:10:14 2005
@@ -16,14 +16,13 @@
*/
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
+import org.apache.ws.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
/**
* @author Malinda Kaushalye
@@ -31,12 +30,10 @@
* Reason token
* @see org.apache.ws.sandbox.security.trust.message.token.Status
*/
-public class Reason extends AbstractToken {
+public class Reason extends ValueElement {
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.REASON_LN, TrustConstants.WST_PREFIX);
- private Text valueText;
-
/**
* Constructor for Reason
*
@@ -68,31 +65,6 @@
this.element.appendChild(valueText);
}
- /**
- * Set the reason value
- *
- * @param val
- */
- public void setValue(String val) {
- if(this.valueText != null)
- this.element.removeChild(this.valueText);
-
- this.valueText = this.element.getOwnerDocument().createTextNode(val);
- this.element.appendChild(valueText);
- }
-
- /**
- * get the value of the reason token
- *
- * @return
- */
- public String getValue() {
- if(this.valueText != null)
- return this.valueText.getNodeValue();
- else
- return null;
- }
-
/**
* Returns the QName of this type
* @see org.apache.ws.sandbox.security.trust.message.token.AbstractToken#getToken()
@@ -101,19 +73,4 @@
return TOKEN;
}
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
- */
- protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
- // TODO Auto-generated method stub
-
- }
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewRequestSecurityToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewRequestSecurityToken.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewRequestSecurityToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewRequestSecurityToken.java Sun Oct 30 07:10:14 2005
@@ -16,14 +16,14 @@
*/
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.message.token.SecurityTokenReference;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.message.token.SecurityTokenReference;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
/**
* This is the class to be used to enerate a RequestSecurityToken for the
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewTarget.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewTarget.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewTarget.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RenewTarget.java Sun Oct 30 07:10:14 2005
@@ -17,17 +17,16 @@
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
+import org.apache.ws.sandbox.security.trust.TrustConstants;
+import org.apache.ws.sandbox.security.trust.WSTrustException;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSConfig;
import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.message.token.SecurityTokenReference;
-import org.apache.ws.sandbox.security.trust.TrustConstants;
-import org.apache.ws.sandbox.security.trust.WSTrustException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import javax.xml.namespace.QName;
+
/**
* @author Ruchith Fernando (ruchith.fernando@gmail.com)
*/
@@ -104,13 +103,13 @@
QName secTokRef = new QName(WSConstants.WSSE_NS, SecurityTokenReference.SECURITY_TOKEN_REFERENCE);
- if(el.equals(secTokRef)) {
+ if(el.equals(secTokRef) && this.tokenToBeRenewed == null) {
try {
this.securityTokenReference = new SecurityTokenReference(elem);
} catch (WSSecurityException ex) {
throw new WSTrustException(WSTrustException.INVALID_REQUEST, ex.getMessage());
}
- } else {
+ } else if(this.securityTokenReference == null) {
this.tokenToBeRenewed = elem;
}
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Renewing.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Renewing.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Renewing.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Renewing.java Sun Oct 30 07:10:14 2005
@@ -110,16 +110,16 @@
/* (non-Javadoc)
* @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
*/
- protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
-
+ protected void deserializeChildElement(Element elem) throws WSTrustException {
+ throw new WSTrustException(WSTrustException.INVALID_REQUEST,
+ "There cannot be a child element in this element");
}
/* (non-Javadoc)
* @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
*/
- protected void setElementTextValue(Text textNode) {
- // TODO Auto-generated method stub
-
+ protected void setElementTextValue(Text textNode) throws WSTrustException {
+ throw new WSTrustException(WSTrustException.INVALID_REQUEST,
+ "There cannot be a value in this element");
}
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestSecurityTokenResponse.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestSecurityTokenResponse.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestSecurityTokenResponse.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestSecurityTokenResponse.java Sun Oct 30 07:10:14 2005
@@ -17,23 +17,21 @@
package org.apache.ws.sandbox.security.trust.message.token;
-import java.io.ByteArrayOutputStream;
-
-import javax.xml.namespace.QName;
-
import org.apache.axis.components.logger.LogFactory;
import org.apache.commons.logging.Log;
-import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
+import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-public class RequestSecurityTokenResponse extends AbstractToken {
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.namespace.QName;
+
+public class RequestSecurityTokenResponse extends CompositeElement {
private static Log log = LogFactory.getLog(RequestSecurityTokenResponse.class.getName());
@@ -187,14 +185,6 @@
* @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
*/
protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
// TODO Auto-generated method stub
}
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestType.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestType.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestType.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestType.java Sun Oct 30 07:10:14 2005
@@ -16,14 +16,13 @@
*/
package org.apache.ws.sandbox.security.trust.message.token;
-import javax.xml.namespace.QName;
-
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.sandbox.security.trust.WSTrustException;
+import org.apache.ws.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Text;
+
+import javax.xml.namespace.QName;
/**
* @author Malinda Kaushalye
@@ -35,8 +34,6 @@
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.REQUEST_TYPE_LN, TrustConstants.WST_PREFIX);
- private Text valueText;
-
/**
* Constructor for RequestType
*
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java Sun Oct 30 07:10:14 2005
@@ -18,22 +18,21 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.ws.sandbox.security.trust.TrustConstants;
import org.apache.ws.security.SOAPConstants;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSConfig;
import org.apache.ws.security.WSSecurityEngine;
import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.processor.EncryptedKeyProcessor;
import org.apache.ws.security.components.crypto.Crypto;
import org.apache.ws.security.message.WSEncryptBody;
import org.apache.ws.security.message.token.BinarySecurity;
import org.apache.ws.security.message.token.Reference;
import org.apache.ws.security.message.token.SecurityTokenReference;
import org.apache.ws.security.message.token.X509Security;
-import org.apache.ws.sandbox.security.trust.TrustConstants;
+import org.apache.ws.security.processor.EncryptedKeyProcessor;
import org.apache.ws.security.util.DOM2Writer;
-import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.ws.security.util.Loader;
+import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.encryption.XMLEncryptionException;
import org.apache.xml.security.keys.KeyInfo;
@@ -45,6 +44,10 @@
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
@@ -52,9 +55,6 @@
import javax.crypto.SecretKey;
import javax.security.auth.callback.CallbackHandler;
import javax.xml.namespace.QName;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.X509Certificate;
/**
* @author Dimuthu Leelarathne. (muthulee@yahoo.com)
Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Status.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Status.java?rev=329581&r1=329580&r2=329581&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Status.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/Status.java Sun Oct 30 07:10:14 2005
@@ -29,7 +29,7 @@
* @author Malinda Kaushalye
* @author Ruchith Fernando
*/
-public class Status extends AbstractToken {
+public class Status extends CompositeElement {
public static final QName TOKEN = new QName(TrustConstants.WST_NS, TrustConstants.STATUS_LN, TrustConstants.WST_PREFIX);
@@ -121,16 +121,19 @@
/* (non-Javadoc)
* @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElement(org.w3c.dom.Element)
*/
- protected void deserializeChildElement(Element elem) {
- // TODO Auto-generated method stub
-
+ protected void deserializeChildElement(Element elem) throws WSTrustException{
+ QName el = new QName(elem.getNamespaceURI(), elem.getLocalName());
+ if(el.equals(Code.TOKEN)) {
+ this.codeElement = new Code(elem);
+ } else if(el.equals(Reason.TOKEN)) {
+ this.reasonElement = new Reason(elem);
+ } else {
+ throw new WSTrustException(WSTrustException.INVALID_REQUEST,
+ WSTrustException.DESC_INCORRECT_CHILD_ELEM,
+ new Object[] {
+ TOKEN.getPrefix(),TOKEN.getLocalPart(),
+ el.getNamespaceURI(),el.getLocalPart()});
+ }
}
- /* (non-Javadoc)
- * @see org.apache.ws.security.trust.message.token.AbstractToken#deserializeElementText(org.w3c.dom.Text)
- */
- protected void setElementTextValue(Text textNode) {
- // TODO Auto-generated method stub
-
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org