Author: ruchithf
Date: Thu Nov 3 11:11:49 2005
New Revision: 330609
URL: http://svn.apache.org/viewcvs?rev=330609&view=rev
Log:
Enable turning off signatureConfirmation
Modified:
webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java
webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandlerConstants.java
Modified: webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java?rev=330609&r1=330608&r2=330609&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java Thu Nov 3 11:11:49 2005
@@ -81,6 +81,10 @@
boolean mu = decodeMustUnderstand(reqData);
WSSConfig wssConfig = WSSConfig.getNewInstance();
+
+ wssConfig
+ .setEnableSignatureConfirmation(decodeEnableSignatureConfirmation(reqData));
+
wssConfig
.setPrecisionInMilliSeconds(decodeTimestampPrecision(reqData));
reqData.setWssConfig(wssConfig);
@@ -207,10 +211,14 @@
}
}
- protected void doReceiverAction(int doAction, RequestData reqData)
+
+
+ protected void doReceiverAction(int doAction, RequestData reqData)
throws WSSecurityException {
WSSConfig wssConfig = WSSConfig.getNewInstance();
+ wssConfig
+ .setEnableSignatureConfirmation(decodeEnableSignatureConfirmation(reqData));
reqData.setWssConfig(wssConfig);
if ((doAction & WSConstants.SIGN) == WSConstants.SIGN) {
@@ -490,6 +498,20 @@
}
return ttl_i;
}
+
+ protected boolean decodeEnableSignatureConfirmation(RequestData reqData) throws WSSecurityException {
+
+ String value = getString(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION,
+ reqData.getMsgContext());
+
+ if (value == null) {return true;}
+
+ if ("0".equals(value) || "false".equals(value)) {return false;}
+ if ("1".equals(value) || "true".equals(value)) {return true;}
+
+ throw new WSSecurityException(
+ "WSHandler: illegal enableSignatureConfirmation parameter");
+ }
protected boolean decodeTimestampPrecision(RequestData reqData)
throws WSSecurityException {
Modified: webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandlerConstants.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandlerConstants.java?rev=330609&r1=330608&r2=330609&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandlerConstants.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandlerConstants.java Thu Nov 3 11:11:49 2005
@@ -651,6 +651,12 @@
public static final String TTL_TIMESTAMP = "timeToLive";
/**
+ * Whether to enable signatureConfirmation or not
+ * By default signatureConfirmation is enabled
+ */
+ public static final String ENABLE_SIGNATURE_CONFIRMATION = "enableSignatureConfirmation";
+
+ /**
* Should timestamps have precision in milliseconds
*/
public static final String TIMESTAMP_PRECISION = "precisionInMilliseconds";
---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org