ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1040461 [18/28] - in /webservices/wss4j/site: ./ apidocs/ apidocs/org/apache/ws/axis/security/ apidocs/org/apache/ws/axis/security/class-use/ apidocs/org/apache/ws/axis/security/handler/ apidocs/org/apache/ws/axis/security/handler/class-us...
Date Tue, 30 Nov 2010 11:10:41 GMT
Modified: webservices/wss4j/site/xref/org/apache/ws/security/handler/WSHandler.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/handler/WSHandler.html?rev=1040461&r1=1040460&r2=1040461&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/handler/WSHandler.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/handler/WSHandler.html Tue Nov 30 11:10:26 2010
@@ -110,1316 +110,1411 @@
 <a name="100" href="#100">100</a>         wssConfig.setEnableSignatureConfirmation(
 <a name="101" href="#101">101</a>             enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
 <a name="102" href="#102">102</a>         );
-<a name="103" href="#103">103</a> 
-<a name="104" href="#104">104</a>         wssConfig.setPrecisionInMilliSeconds(
-<a name="105" href="#105">105</a>             decodeTimestampPrecision(reqData)
-<a name="106" href="#106">106</a>         );
-<a name="107" href="#107">107</a>         reqData.setWssConfig(wssConfig);
-<a name="108" href="#108">108</a> 
-<a name="109" href="#109">109</a>         Object mc = reqData.getMsgContext();
-<a name="110" href="#110">110</a>         String actor = getString(WSHandlerConstants.ACTOR, mc);
-<a name="111" href="#111">111</a>         reqData.setActor(actor);
-<a name="112" href="#112">112</a> 
-<a name="113" href="#113">113</a>         <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a>(actor, mu);
-<a name="114" href="#114">114</a>         secHeader.insertSecurityHeader(doc);
-<a name="115" href="#115">115</a> 
-<a name="116" href="#116">116</a>         reqData.setSecHeader(secHeader);
-<a name="117" href="#117">117</a>         reqData.setSoapConstants(
-<a name="118" href="#118">118</a>             WSSecurityUtil.getSOAPConstants(doc.getDocumentElement())
-<a name="119" href="#119">119</a>         );
-<a name="120" href="#120">120</a>         <em class="jxr_comment">/*</em>
-<a name="121" href="#121">121</a> <em class="jxr_comment">         * Here we have action, username, password, and actor, mustUnderstand.</em>
-<a name="122" href="#122">122</a> <em class="jxr_comment">         * Now get the action specific parameters.</em>
-<a name="123" href="#123">123</a> <em class="jxr_comment">         */</em>
-<a name="124" href="#124">124</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.UT) == WSConstants.UT) {
-<a name="125" href="#125">125</a>             decodeUTParameter(reqData);
-<a name="126" href="#126">126</a>         }
-<a name="127" href="#127">127</a>         <em class="jxr_comment">/*</em>
-<a name="128" href="#128">128</a> <em class="jxr_comment">         * Here we have action, username, password, and actor, mustUnderstand.</em>
-<a name="129" href="#129">129</a> <em class="jxr_comment">         * Now get the action specific parameters.</em>
-<a name="130" href="#130">130</a> <em class="jxr_comment">         */</em>
-<a name="131" href="#131">131</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.UT_SIGN) == WSConstants.UT_SIGN) {
-<a name="132" href="#132">132</a>             decodeUTParameter(reqData);
-<a name="133" href="#133">133</a>             decodeSignatureParameter(reqData);
-<a name="134" href="#134">134</a>         }
-<a name="135" href="#135">135</a>         <em class="jxr_comment">/*</em>
-<a name="136" href="#136">136</a> <em class="jxr_comment">         * Get and check the Signature specific parameters first because they</em>
-<a name="137" href="#137">137</a> <em class="jxr_comment">         * may be used for encryption too.</em>
-<a name="138" href="#138">138</a> <em class="jxr_comment">         */</em>
-<a name="139" href="#139">139</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.SIGN) == WSConstants.SIGN) {
-<a name="140" href="#140">140</a>             reqData.setSigCrypto(loadSignatureCrypto(reqData));
-<a name="141" href="#141">141</a>             decodeSignatureParameter(reqData);
-<a name="142" href="#142">142</a>         }
-<a name="143" href="#143">143</a>         <em class="jxr_comment">/*</em>
-<a name="144" href="#144">144</a> <em class="jxr_comment">         * If we need to handle signed SAML token then we may need the</em>
-<a name="145" href="#145">145</a> <em class="jxr_comment">         * Signature parameters. The handle procedure loads the signature crypto</em>
-<a name="146" href="#146">146</a> <em class="jxr_comment">         * file on demand, thus don't do it here.</em>
-<a name="147" href="#147">147</a> <em class="jxr_comment">         */</em>
-<a name="148" href="#148">148</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED) {
-<a name="149" href="#149">149</a>             decodeSignatureParameter(reqData);
-<a name="150" href="#150">150</a>         }
-<a name="151" href="#151">151</a>         <em class="jxr_comment">/*</em>
-<a name="152" href="#152">152</a> <em class="jxr_comment">         * Set and check the encryption specific parameters, if necessary take</em>
-<a name="153" href="#153">153</a> <em class="jxr_comment">         * over signature parameters username and crypto instance.</em>
-<a name="154" href="#154">154</a> <em class="jxr_comment">         */</em>
-<a name="155" href="#155">155</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
-<a name="156" href="#156">156</a>             reqData.setEncCrypto(loadEncryptionCrypto(reqData));
-<a name="157" href="#157">157</a>             decodeEncryptionParameter(reqData);
-<a name="158" href="#158">158</a>         }
-<a name="159" href="#159">159</a>         <em class="jxr_comment">/*</em>
-<a name="160" href="#160">160</a> <em class="jxr_comment">         * If after all the parsing no Signature parts defined, set here a</em>
-<a name="161" href="#161">161</a> <em class="jxr_comment">         * default set. This is necessary because we add SignatureConfirmation</em>
-<a name="162" href="#162">162</a> <em class="jxr_comment">         * and therefore the default (Body) must be set here. The default setting</em>
-<a name="163" href="#163">163</a> <em class="jxr_comment">         * in WSSignEnvelope doesn't work because the vector is not empty anymore.</em>
-<a name="164" href="#164">164</a> <em class="jxr_comment">         */</em>
-<a name="165" href="#165">165</a>         <strong class="jxr_keyword">if</strong> (reqData.getSignatureParts().isEmpty()) {
-<a name="166" href="#166">166</a>             <a href="../../../../../org/apache/ws/security/WSEncryptionPart.html">WSEncryptionPart</a> encP = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSEncryptionPart.html">WSEncryptionPart</a>(reqData.getSoapConstants()
-<a name="167" href="#167">167</a>                     .getBodyQName().getLocalPart(), reqData.getSoapConstants()
-<a name="168" href="#168">168</a>                     .getEnvelopeURI(), <span class="jxr_string">"Content"</span>);
-<a name="169" href="#169">169</a>             reqData.getSignatureParts().add(encP);
-<a name="170" href="#170">170</a>         }
-<a name="171" href="#171">171</a>         <em class="jxr_comment">/*</em>
-<a name="172" href="#172">172</a> <em class="jxr_comment">         * If SignatureConfirmation is enabled and this is a response then</em>
-<a name="173" href="#173">173</a> <em class="jxr_comment">         * insert SignatureConfrmation elements, note their wsu:id in the signature</em>
-<a name="174" href="#174">174</a> <em class="jxr_comment">         * parts. They will be signed automatically during a (probably) defined</em>
-<a name="175" href="#175">175</a> <em class="jxr_comment">         * SIGN action.</em>
-<a name="176" href="#176">176</a> <em class="jxr_comment">         */</em>
-<a name="177" href="#177">177</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() &amp;&amp; !isRequest) {
-<a name="178" href="#178">178</a>             String done = (String) 
-<a name="179" href="#179">179</a>                 getProperty(reqData.getMsgContext(), WSHandlerConstants.SIG_CONF_DONE);
-<a name="180" href="#180">180</a>             <strong class="jxr_keyword">if</strong> (!DONE.equals(done)
-<a name="181" href="#181">181</a>                 &amp;&amp; (getProperty(reqData.getMsgContext(), WSHandlerConstants.RECV_RESULTS)) 
-<a name="182" href="#182">182</a>                     != <strong class="jxr_keyword">null</strong>) {
-<a name="183" href="#183">183</a>                 wssConfig.getAction(WSConstants.SC).execute(<strong class="jxr_keyword">this</strong>, WSConstants.SC, doc, reqData);
-<a name="184" href="#184">184</a>             }
-<a name="185" href="#185">185</a>         }
-<a name="186" href="#186">186</a>         <em class="jxr_comment">/*</em>
-<a name="187" href="#187">187</a> <em class="jxr_comment">         * Here we have all necessary information to perform the requested</em>
-<a name="188" href="#188">188</a> <em class="jxr_comment">         * action(s).</em>
-<a name="189" href="#189">189</a> <em class="jxr_comment">         */</em>
-<a name="190" href="#190">190</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; actions.size(); i++) {
-<a name="191" href="#191">191</a> 
-<a name="192" href="#192">192</a>             <strong class="jxr_keyword">int</strong> actionToDo = ((Integer) actions.get(i)).intValue();
-<a name="193" href="#193">193</a>             <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="194" href="#194">194</a>                 log.debug(<span class="jxr_string">"Performing Action: "</span> + actionToDo);
-<a name="195" href="#195">195</a>             }
-<a name="196" href="#196">196</a> 
-<a name="197" href="#197">197</a>             <strong class="jxr_keyword">switch</strong> (actionToDo) {
-<a name="198" href="#198">198</a>             <strong class="jxr_keyword">case</strong> WSConstants.UT:
-<a name="199" href="#199">199</a>             <strong class="jxr_keyword">case</strong> WSConstants.ENCR:
-<a name="200" href="#200">200</a>             <strong class="jxr_keyword">case</strong> WSConstants.SIGN:
-<a name="201" href="#201">201</a>             <strong class="jxr_keyword">case</strong> WSConstants.ST_SIGNED:
-<a name="202" href="#202">202</a>             <strong class="jxr_keyword">case</strong> WSConstants.ST_UNSIGNED:
-<a name="203" href="#203">203</a>             <strong class="jxr_keyword">case</strong> WSConstants.TS:
-<a name="204" href="#204">204</a>             <strong class="jxr_keyword">case</strong> WSConstants.UT_SIGN:
-<a name="205" href="#205">205</a>                 wssConfig.getAction(actionToDo).execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
-<a name="206" href="#206">206</a>                 <strong class="jxr_keyword">break</strong>;
-<a name="207" href="#207">207</a>             <strong class="jxr_keyword">case</strong> WSConstants.NO_SERIALIZE:
-<a name="208" href="#208">208</a>                 reqData.setNoSerialization(<strong class="jxr_keyword">true</strong>);
-<a name="209" href="#209">209</a>                 <strong class="jxr_keyword">break</strong>;
-<a name="210" href="#210">210</a>                 <em class="jxr_comment">//</em>
-<a name="211" href="#211">211</a>                 <em class="jxr_comment">// Handle any "custom" actions, similarly,</em>
-<a name="212" href="#212">212</a>                 <em class="jxr_comment">// but to preserve behavior from previous</em>
-<a name="213" href="#213">213</a>                 <em class="jxr_comment">// versions, consume (but log) action lookup failures.</em>
-<a name="214" href="#214">214</a>                 <em class="jxr_comment">//</em>
-<a name="215" href="#215">215</a>             <strong class="jxr_keyword">default</strong>:
-<a name="216" href="#216">216</a>                 <a href="../../../../../org/apache/ws/security/action/Action.html">Action</a> doit = <strong class="jxr_keyword">null</strong>;
-<a name="217" href="#217">217</a>             <strong class="jxr_keyword">try</strong> {
-<a name="218" href="#218">218</a>                 doit = wssConfig.getAction(actionToDo);
-<a name="219" href="#219">219</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> WSSecurityException e) {
-<a name="220" href="#220">220</a>                 log.warn(
-<a name="221" href="#221">221</a>                         <span class="jxr_string">"Error trying to locate a custom action ("</span> + actionToDo + <span class="jxr_string">")"</span>, 
-<a name="222" href="#222">222</a>                         e
-<a name="223" href="#223">223</a>                 );
-<a name="224" href="#224">224</a>             }
-<a name="225" href="#225">225</a>             <strong class="jxr_keyword">if</strong> (doit != <strong class="jxr_keyword">null</strong>) {
-<a name="226" href="#226">226</a>                 doit.execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
-<a name="227" href="#227">227</a>             }
+<a name="103" href="#103">103</a>         wssConfig.setPasswordsAreEncoded(decodeUseEncodedPasswords(reqData));
+<a name="104" href="#104">104</a> 
+<a name="105" href="#105">105</a>         wssConfig.setPrecisionInMilliSeconds(
+<a name="106" href="#106">106</a>             decodeTimestampPrecision(reqData)
+<a name="107" href="#107">107</a>         );
+<a name="108" href="#108">108</a>         reqData.setWssConfig(wssConfig);
+<a name="109" href="#109">109</a> 
+<a name="110" href="#110">110</a>         Object mc = reqData.getMsgContext();
+<a name="111" href="#111">111</a>         String actor = getString(WSHandlerConstants.ACTOR, mc);
+<a name="112" href="#112">112</a>         reqData.setActor(actor);
+<a name="113" href="#113">113</a> 
+<a name="114" href="#114">114</a>         <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a>(actor, mu);
+<a name="115" href="#115">115</a>         secHeader.insertSecurityHeader(doc);
+<a name="116" href="#116">116</a> 
+<a name="117" href="#117">117</a>         reqData.setSecHeader(secHeader);
+<a name="118" href="#118">118</a>         reqData.setSoapConstants(
+<a name="119" href="#119">119</a>             WSSecurityUtil.getSOAPConstants(doc.getDocumentElement())
+<a name="120" href="#120">120</a>         );
+<a name="121" href="#121">121</a>         <em class="jxr_comment">/*</em>
+<a name="122" href="#122">122</a> <em class="jxr_comment">         * Here we have action, username, password, and actor, mustUnderstand.</em>
+<a name="123" href="#123">123</a> <em class="jxr_comment">         * Now get the action specific parameters.</em>
+<a name="124" href="#124">124</a> <em class="jxr_comment">         */</em>
+<a name="125" href="#125">125</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.UT) == WSConstants.UT) {
+<a name="126" href="#126">126</a>             decodeUTParameter(reqData);
+<a name="127" href="#127">127</a>         }
+<a name="128" href="#128">128</a>         <em class="jxr_comment">/*</em>
+<a name="129" href="#129">129</a> <em class="jxr_comment">         * Here we have action, username, password, and actor, mustUnderstand.</em>
+<a name="130" href="#130">130</a> <em class="jxr_comment">         * Now get the action specific parameters.</em>
+<a name="131" href="#131">131</a> <em class="jxr_comment">         */</em>
+<a name="132" href="#132">132</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.UT_SIGN) == WSConstants.UT_SIGN) {
+<a name="133" href="#133">133</a>             decodeUTParameter(reqData);
+<a name="134" href="#134">134</a>             decodeSignatureParameter(reqData);
+<a name="135" href="#135">135</a>         }
+<a name="136" href="#136">136</a>         <em class="jxr_comment">/*</em>
+<a name="137" href="#137">137</a> <em class="jxr_comment">         * Get and check the Signature specific parameters first because they</em>
+<a name="138" href="#138">138</a> <em class="jxr_comment">         * may be used for encryption too.</em>
+<a name="139" href="#139">139</a> <em class="jxr_comment">         */</em>
+<a name="140" href="#140">140</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.SIGN) == WSConstants.SIGN) {
+<a name="141" href="#141">141</a>             reqData.setSigCrypto(loadSignatureCrypto(reqData));
+<a name="142" href="#142">142</a>             decodeSignatureParameter(reqData);
+<a name="143" href="#143">143</a>         }
+<a name="144" href="#144">144</a>         <em class="jxr_comment">/*</em>
+<a name="145" href="#145">145</a> <em class="jxr_comment">         * If we need to handle signed SAML token then we may need the</em>
+<a name="146" href="#146">146</a> <em class="jxr_comment">         * Signature parameters. The handle procedure loads the signature crypto</em>
+<a name="147" href="#147">147</a> <em class="jxr_comment">         * file on demand, thus don't do it here.</em>
+<a name="148" href="#148">148</a> <em class="jxr_comment">         */</em>
+<a name="149" href="#149">149</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED) {
+<a name="150" href="#150">150</a>             decodeSignatureParameter(reqData);
+<a name="151" href="#151">151</a>         }
+<a name="152" href="#152">152</a>         <em class="jxr_comment">/*</em>
+<a name="153" href="#153">153</a> <em class="jxr_comment">         * Set and check the encryption specific parameters, if necessary take</em>
+<a name="154" href="#154">154</a> <em class="jxr_comment">         * over signature parameters username and crypto instance.</em>
+<a name="155" href="#155">155</a> <em class="jxr_comment">         */</em>
+<a name="156" href="#156">156</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
+<a name="157" href="#157">157</a>             reqData.setEncCrypto(loadEncryptionCrypto(reqData));
+<a name="158" href="#158">158</a>             decodeEncryptionParameter(reqData);
+<a name="159" href="#159">159</a>         }
+<a name="160" href="#160">160</a>         <em class="jxr_comment">/*</em>
+<a name="161" href="#161">161</a> <em class="jxr_comment">         * If after all the parsing no Signature parts defined, set here a</em>
+<a name="162" href="#162">162</a> <em class="jxr_comment">         * default set. This is necessary because we add SignatureConfirmation</em>
+<a name="163" href="#163">163</a> <em class="jxr_comment">         * and therefore the default (Body) must be set here. The default setting</em>
+<a name="164" href="#164">164</a> <em class="jxr_comment">         * in WSSignEnvelope doesn't work because the vector is not empty anymore.</em>
+<a name="165" href="#165">165</a> <em class="jxr_comment">         */</em>
+<a name="166" href="#166">166</a>         <strong class="jxr_keyword">if</strong> (reqData.getSignatureParts().isEmpty()) {
+<a name="167" href="#167">167</a>             <a href="../../../../../org/apache/ws/security/WSEncryptionPart.html">WSEncryptionPart</a> encP = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSEncryptionPart.html">WSEncryptionPart</a>(reqData.getSoapConstants()
+<a name="168" href="#168">168</a>                     .getBodyQName().getLocalPart(), reqData.getSoapConstants()
+<a name="169" href="#169">169</a>                     .getEnvelopeURI(), <span class="jxr_string">"Content"</span>);
+<a name="170" href="#170">170</a>             reqData.getSignatureParts().add(encP);
+<a name="171" href="#171">171</a>         }
+<a name="172" href="#172">172</a>         <em class="jxr_comment">/*</em>
+<a name="173" href="#173">173</a> <em class="jxr_comment">         * If SignatureConfirmation is enabled and this is a response then</em>
+<a name="174" href="#174">174</a> <em class="jxr_comment">         * insert SignatureConfrmation elements, note their wsu:id in the signature</em>
+<a name="175" href="#175">175</a> <em class="jxr_comment">         * parts. They will be signed automatically during a (probably) defined</em>
+<a name="176" href="#176">176</a> <em class="jxr_comment">         * SIGN action.</em>
+<a name="177" href="#177">177</a> <em class="jxr_comment">         */</em>
+<a name="178" href="#178">178</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() &amp;&amp; !isRequest) {
+<a name="179" href="#179">179</a>             String done = (String) 
+<a name="180" href="#180">180</a>                 getProperty(reqData.getMsgContext(), WSHandlerConstants.SIG_CONF_DONE);
+<a name="181" href="#181">181</a>             <strong class="jxr_keyword">if</strong> (!DONE.equals(done)
+<a name="182" href="#182">182</a>                 &amp;&amp; (getProperty(reqData.getMsgContext(), WSHandlerConstants.RECV_RESULTS)) 
+<a name="183" href="#183">183</a>                     != <strong class="jxr_keyword">null</strong>) {
+<a name="184" href="#184">184</a>                 wssConfig.getAction(WSConstants.SC).execute(<strong class="jxr_keyword">this</strong>, WSConstants.SC, doc, reqData);
+<a name="185" href="#185">185</a>             }
+<a name="186" href="#186">186</a>         }
+<a name="187" href="#187">187</a>         <em class="jxr_comment">/*</em>
+<a name="188" href="#188">188</a> <em class="jxr_comment">         * Here we have all necessary information to perform the requested</em>
+<a name="189" href="#189">189</a> <em class="jxr_comment">         * action(s).</em>
+<a name="190" href="#190">190</a> <em class="jxr_comment">         */</em>
+<a name="191" href="#191">191</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; actions.size(); i++) {
+<a name="192" href="#192">192</a> 
+<a name="193" href="#193">193</a>             <strong class="jxr_keyword">int</strong> actionToDo = ((Integer) actions.get(i)).intValue();
+<a name="194" href="#194">194</a>             <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="195" href="#195">195</a>                 log.debug(<span class="jxr_string">"Performing Action: "</span> + actionToDo);
+<a name="196" href="#196">196</a>             }
+<a name="197" href="#197">197</a> 
+<a name="198" href="#198">198</a>             <strong class="jxr_keyword">switch</strong> (actionToDo) {
+<a name="199" href="#199">199</a>             <strong class="jxr_keyword">case</strong> WSConstants.UT:
+<a name="200" href="#200">200</a>             <strong class="jxr_keyword">case</strong> WSConstants.ENCR:
+<a name="201" href="#201">201</a>             <strong class="jxr_keyword">case</strong> WSConstants.SIGN:
+<a name="202" href="#202">202</a>             <strong class="jxr_keyword">case</strong> WSConstants.ST_SIGNED:
+<a name="203" href="#203">203</a>             <strong class="jxr_keyword">case</strong> WSConstants.ST_UNSIGNED:
+<a name="204" href="#204">204</a>             <strong class="jxr_keyword">case</strong> WSConstants.TS:
+<a name="205" href="#205">205</a>             <strong class="jxr_keyword">case</strong> WSConstants.UT_SIGN:
+<a name="206" href="#206">206</a>                 wssConfig.getAction(actionToDo).execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
+<a name="207" href="#207">207</a>                 <strong class="jxr_keyword">break</strong>;
+<a name="208" href="#208">208</a>             <strong class="jxr_keyword">case</strong> WSConstants.NO_SERIALIZE:
+<a name="209" href="#209">209</a>                 reqData.setNoSerialization(<strong class="jxr_keyword">true</strong>);
+<a name="210" href="#210">210</a>                 <strong class="jxr_keyword">break</strong>;
+<a name="211" href="#211">211</a>                 <em class="jxr_comment">//</em>
+<a name="212" href="#212">212</a>                 <em class="jxr_comment">// Handle any "custom" actions, similarly,</em>
+<a name="213" href="#213">213</a>                 <em class="jxr_comment">// but to preserve behavior from previous</em>
+<a name="214" href="#214">214</a>                 <em class="jxr_comment">// versions, consume (but log) action lookup failures.</em>
+<a name="215" href="#215">215</a>                 <em class="jxr_comment">//</em>
+<a name="216" href="#216">216</a>             <strong class="jxr_keyword">default</strong>:
+<a name="217" href="#217">217</a>                 <a href="../../../../../org/apache/ws/security/action/Action.html">Action</a> doit = <strong class="jxr_keyword">null</strong>;
+<a name="218" href="#218">218</a>             <strong class="jxr_keyword">try</strong> {
+<a name="219" href="#219">219</a>                 doit = wssConfig.getAction(actionToDo);
+<a name="220" href="#220">220</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> WSSecurityException e) {
+<a name="221" href="#221">221</a>                 log.warn(
+<a name="222" href="#222">222</a>                         <span class="jxr_string">"Error trying to locate a custom action ("</span> + actionToDo + <span class="jxr_string">")"</span>, 
+<a name="223" href="#223">223</a>                         e
+<a name="224" href="#224">224</a>                 );
+<a name="225" href="#225">225</a>             }
+<a name="226" href="#226">226</a>             <strong class="jxr_keyword">if</strong> (doit != <strong class="jxr_keyword">null</strong>) {
+<a name="227" href="#227">227</a>                 doit.execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
 <a name="228" href="#228">228</a>             }
-<a name="229" href="#229">229</a>         }
-<a name="230" href="#230">230</a>         
-<a name="231" href="#231">231</a>         <em class="jxr_comment">/*</em>
-<a name="232" href="#232">232</a> <em class="jxr_comment">         * If this is a request then store all signature values. Add ours to</em>
-<a name="233" href="#233">233</a> <em class="jxr_comment">         * already gathered values because of chained handlers, e.g. for</em>
-<a name="234" href="#234">234</a> <em class="jxr_comment">         * other actors.</em>
-<a name="235" href="#235">235</a> <em class="jxr_comment">         */</em>
-<a name="236" href="#236">236</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() 
-<a name="237" href="#237">237</a>                 &amp;&amp; isRequest
-<a name="238" href="#238">238</a>                 &amp;&amp; reqData.getSignatureValues().size() &gt; 0) {
-<a name="239" href="#239">239</a>             Vector sigv = (Vector) 
-<a name="240" href="#240">240</a>             getProperty(reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV);
-<a name="241" href="#241">241</a>             <strong class="jxr_keyword">if</strong> (sigv == <strong class="jxr_keyword">null</strong>) {
-<a name="242" href="#242">242</a>                 sigv = <strong class="jxr_keyword">new</strong> Vector();
-<a name="243" href="#243">243</a>                 setProperty(reqData.getMsgContext(),
-<a name="244" href="#244">244</a>                         WSHandlerConstants.SEND_SIGV, sigv);
-<a name="245" href="#245">245</a>             }
-<a name="246" href="#246">246</a>             <em class="jxr_comment">// sigv.add(reqData.getSignatureValues());</em>
-<a name="247" href="#247">247</a>             sigv.addAll(reqData.getSignatureValues());
-<a name="248" href="#248">248</a>         }
-<a name="249" href="#249">249</a>     }
-<a name="250" href="#250">250</a> 
+<a name="229" href="#229">229</a>             }
+<a name="230" href="#230">230</a>         }
+<a name="231" href="#231">231</a>         
+<a name="232" href="#232">232</a>         <em class="jxr_comment">/*</em>
+<a name="233" href="#233">233</a> <em class="jxr_comment">         * If this is a request then store all signature values. Add ours to</em>
+<a name="234" href="#234">234</a> <em class="jxr_comment">         * already gathered values because of chained handlers, e.g. for</em>
+<a name="235" href="#235">235</a> <em class="jxr_comment">         * other actors.</em>
+<a name="236" href="#236">236</a> <em class="jxr_comment">         */</em>
+<a name="237" href="#237">237</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() 
+<a name="238" href="#238">238</a>                 &amp;&amp; isRequest
+<a name="239" href="#239">239</a>                 &amp;&amp; reqData.getSignatureValues().size() &gt; 0) {
+<a name="240" href="#240">240</a>             Vector sigv = (Vector) 
+<a name="241" href="#241">241</a>             getProperty(reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV);
+<a name="242" href="#242">242</a>             <strong class="jxr_keyword">if</strong> (sigv == <strong class="jxr_keyword">null</strong>) {
+<a name="243" href="#243">243</a>                 sigv = <strong class="jxr_keyword">new</strong> Vector();
+<a name="244" href="#244">244</a>                 setProperty(reqData.getMsgContext(),
+<a name="245" href="#245">245</a>                         WSHandlerConstants.SEND_SIGV, sigv);
+<a name="246" href="#246">246</a>             }
+<a name="247" href="#247">247</a>             <em class="jxr_comment">// sigv.add(reqData.getSignatureValues());</em>
+<a name="248" href="#248">248</a>             sigv.addAll(reqData.getSignatureValues());
+<a name="249" href="#249">249</a>         }
+<a name="250" href="#250">250</a>     }
 <a name="251" href="#251">251</a> 
 <a name="252" href="#252">252</a> 
-<a name="253" href="#253">253</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> doReceiverAction(<strong class="jxr_keyword">int</strong> doAction, <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData)
-<a name="254" href="#254">254</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="255" href="#255">255</a> 
-<a name="256" href="#256">256</a>         <a href="../../../../../org/apache/ws/security/WSSConfig.html">WSSConfig</a> wssConfig = reqData.getWssConfig();
-<a name="257" href="#257">257</a>         <strong class="jxr_keyword">if</strong> (wssConfig == <strong class="jxr_keyword">null</strong>) {
-<a name="258" href="#258">258</a>             wssConfig = secEngine.getWssConfig();
-<a name="259" href="#259">259</a>         }
-<a name="260" href="#260">260</a>         <strong class="jxr_keyword">boolean</strong> enableSigConf = decodeEnableSignatureConfirmation(reqData);
-<a name="261" href="#261">261</a>         wssConfig.setEnableSignatureConfirmation(
-<a name="262" href="#262">262</a>             enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
-<a name="263" href="#263">263</a>         );
-<a name="264" href="#264">264</a>         wssConfig.setTimeStampStrict(decodeTimestampStrict(reqData));
-<a name="265" href="#265">265</a>         wssConfig.setHandleCustomPasswordTypes(decodeCustomPasswordTypes(reqData));
-<a name="266" href="#266">266</a>         wssConfig.setAllowNamespaceQualifiedPasswordTypes(
-<a name="267" href="#267">267</a>             decodeNamespaceQualifiedPasswordTypes(reqData)
-<a name="268" href="#268">268</a>         );
-<a name="269" href="#269">269</a>         wssConfig.setSecretKeyLength(reqData.getSecretKeyLength());
-<a name="270" href="#270">270</a>         reqData.setWssConfig(wssConfig);
-<a name="271" href="#271">271</a> 
-<a name="272" href="#272">272</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.SIGN) == WSConstants.SIGN) {
-<a name="273" href="#273">273</a>             decodeSignatureParameter2(reqData);
-<a name="274" href="#274">274</a>         }
-<a name="275" href="#275">275</a>         
-<a name="276" href="#276">276</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED) {
-<a name="277" href="#277">277</a>             decodeSignatureParameter2(reqData);
-<a name="278" href="#278">278</a>         }
-<a name="279" href="#279">279</a>         
-<a name="280" href="#280">280</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
-<a name="281" href="#281">281</a>             decodeDecryptionParameter(reqData);
-<a name="282" href="#282">282</a>         }
-<a name="283" href="#283">283</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.NO_SERIALIZE) == WSConstants.NO_SERIALIZE) {
-<a name="284" href="#284">284</a>             reqData.setNoSerialization(<strong class="jxr_keyword">true</strong>);
-<a name="285" href="#285">285</a>         }
-<a name="286" href="#286">286</a>     }
-<a name="287" href="#287">287</a> 
-<a name="288" href="#288">288</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResults(Vector wsResult, Vector actions) {
-<a name="289" href="#289">289</a>         <strong class="jxr_keyword">int</strong> resultActions = wsResult.size();
-<a name="290" href="#290">290</a>         <strong class="jxr_keyword">int</strong> size = actions.size();
-<a name="291" href="#291">291</a> 
-<a name="292" href="#292">292</a>         <strong class="jxr_keyword">int</strong> ai = 0;
-<a name="293" href="#293">293</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; resultActions; i++) {
-<a name="294" href="#294">294</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) ((WSSecurityEngineResult) wsResult
-<a name="295" href="#295">295</a>                     .get(i)).get(WSSecurityEngineResult.TAG_ACTION);
-<a name="296" href="#296">296</a>             <strong class="jxr_keyword">int</strong> act = actInt.intValue();
-<a name="297" href="#297">297</a>             <strong class="jxr_keyword">if</strong> (act == WSConstants.SC || act == WSConstants.BST) {
-<a name="298" href="#298">298</a>                 <strong class="jxr_keyword">continue</strong>;
-<a name="299" href="#299">299</a>             }
-<a name="300" href="#300">300</a>             <strong class="jxr_keyword">if</strong> (ai &gt;= size || ((Integer) actions.get(ai++)).intValue() != act) {
-<a name="301" href="#301">301</a>                 <strong class="jxr_keyword">return</strong> false;
-<a name="302" href="#302">302</a>             }
-<a name="303" href="#303">303</a>         }
-<a name="304" href="#304">304</a> 
-<a name="305" href="#305">305</a>         <strong class="jxr_keyword">if</strong> (ai != size) {
-<a name="306" href="#306">306</a>             <strong class="jxr_keyword">return</strong> false;
-<a name="307" href="#307">307</a>         }
-<a name="308" href="#308">308</a> 
-<a name="309" href="#309">309</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a name="310" href="#310">310</a>     }
-<a name="311" href="#311">311</a>     
-<a name="312" href="#312">312</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResultsAnyOrder(Vector wsResult, Vector actions) {
-<a name="313" href="#313">313</a> 
-<a name="314" href="#314">314</a>         java.util.List recordedActions = <strong class="jxr_keyword">new</strong> Vector(actions.size());
-<a name="315" href="#315">315</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; actions.size(); i++) {
-<a name="316" href="#316">316</a>             Integer action = (Integer)actions.get(i);
-<a name="317" href="#317">317</a>             recordedActions.add(action);
-<a name="318" href="#318">318</a>         }
-<a name="319" href="#319">319</a>         
-<a name="320" href="#320">320</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; wsResult.size(); i++) {
-<a name="321" href="#321">321</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) ((WSSecurityEngineResult) wsResult
-<a name="322" href="#322">322</a>                     .get(i)).get(WSSecurityEngineResult.TAG_ACTION);
-<a name="323" href="#323">323</a>             <strong class="jxr_keyword">int</strong> act = actInt.intValue();
-<a name="324" href="#324">324</a>             <strong class="jxr_keyword">if</strong> (act == WSConstants.SC || act == WSConstants.BST) {
-<a name="325" href="#325">325</a>                 <strong class="jxr_keyword">continue</strong>;
-<a name="326" href="#326">326</a>             }
-<a name="327" href="#327">327</a>             
-<a name="328" href="#328">328</a>             <strong class="jxr_keyword">if</strong> (!recordedActions.remove(actInt)) {
-<a name="329" href="#329">329</a>                 <strong class="jxr_keyword">return</strong> false;
-<a name="330" href="#330">330</a>             }
-<a name="331" href="#331">331</a>         }
-<a name="332" href="#332">332</a> 
-<a name="333" href="#333">333</a>         <strong class="jxr_keyword">if</strong> (!recordedActions.isEmpty()) {
-<a name="334" href="#334">334</a>             <strong class="jxr_keyword">return</strong> false;
-<a name="335" href="#335">335</a>         }
-<a name="336" href="#336">336</a> 
-<a name="337" href="#337">337</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a name="338" href="#338">338</a>     }
-<a name="339" href="#339">339</a> 
-<a name="340" href="#340">340</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> checkSignatureConfirmation(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData,
-<a name="341" href="#341">341</a>             Vector wsResult) <strong class="jxr_keyword">throws</strong> WSSecurityException{
-<a name="342" href="#342">342</a>         <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="343" href="#343">343</a>             log.debug(<span class="jxr_string">"Check Signature confirmation"</span>);
-<a name="344" href="#344">344</a>         }
-<a name="345" href="#345">345</a> 
-<a name="346" href="#346">346</a>         <em class="jxr_comment">/*</em>
-<a name="347" href="#347">347</a> <em class="jxr_comment">         * First get all Signature values stored during sending the request</em>
-<a name="348" href="#348">348</a> <em class="jxr_comment">         */</em>
-<a name="349" href="#349">349</a>         Vector sigv = (Vector) getProperty(reqData.getMsgContext(),
-<a name="350" href="#350">350</a>                 WSHandlerConstants.SEND_SIGV);
-<a name="351" href="#351">351</a>         <em class="jxr_comment">/*</em>
-<a name="352" href="#352">352</a> <em class="jxr_comment">         * Now get all results that hold a SignatureConfirmation element from</em>
-<a name="353" href="#353">353</a> <em class="jxr_comment">         * the current run of receiver (we can have more than one run: if we</em>
-<a name="354" href="#354">354</a> <em class="jxr_comment">         * have several security header blocks with different actors/roles)</em>
-<a name="355" href="#355">355</a> <em class="jxr_comment">         */</em>
-<a name="356" href="#356">356</a>         Vector sigConf = <strong class="jxr_keyword">new</strong> Vector();
-<a name="357" href="#357">357</a>         WSSecurityUtil.fetchAllActionResults(wsResult, WSConstants.SC, sigConf);
-<a name="358" href="#358">358</a>         <em class="jxr_comment">/*</em>
-<a name="359" href="#359">359</a> <em class="jxr_comment">         * now loop over all SignatureConfirmation results and check:</em>
-<a name="360" href="#360">360</a> <em class="jxr_comment">         * - if there is a signature value and no Signature value generated in request: error</em>
-<a name="361" href="#361">361</a> <em class="jxr_comment">         * - if there is a signature value and no matching Signature value found: error</em>
-<a name="362" href="#362">362</a> <em class="jxr_comment">         * </em>
-<a name="363" href="#363">363</a> <em class="jxr_comment">         *  If a matching value found: remove from vector of stored signature values</em>
-<a name="364" href="#364">364</a> <em class="jxr_comment">         */</em>
-<a name="365" href="#365">365</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; sigConf.size(); i++) {
-<a name="366" href="#366">366</a>             <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result = 
-<a name="367" href="#367">367</a>                 (<a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a>)sigConf.get(i);
-<a name="368" href="#368">368</a>             <a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a> sc = 
-<a name="369" href="#369">369</a>                 (<a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a>)result.get(WSSecurityEngineResult.TAG_SIGNATURE_CONFIRMATION);
-<a name="370" href="#370">370</a> 
-<a name="371" href="#371">371</a>             byte[] sigVal = sc.getSignatureValue();
-<a name="372" href="#372">372</a>             <strong class="jxr_keyword">if</strong> (sigVal != <strong class="jxr_keyword">null</strong>) {
-<a name="373" href="#373">373</a>                 <strong class="jxr_keyword">if</strong> (sigv == <strong class="jxr_keyword">null</strong> || sigv.size() == 0) {
-<a name="374" href="#374">374</a>                     <em class="jxr_comment">// If there are no stored signature values</em>
-<a name="375" href="#375">375</a>                     <strong class="jxr_keyword">if</strong> (sigVal.length != 0) {
-<a name="376" href="#376">376</a>                         <em class="jxr_comment">// If there's no value in the case where there are no</em>
-<a name="377" href="#377">377</a>                         <em class="jxr_comment">// stored SV it is valid. Therefore if there IS a value </em>
-<a name="378" href="#378">378</a>                         <em class="jxr_comment">// in the sig confirmation element</em>
-<a name="379" href="#379">379</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="380" href="#380">380</a>                             <span class="jxr_string">"WSHandler: Check Signature confirmation: got a SC element, "</span>
-<a name="381" href="#381">381</a>                             + <span class="jxr_string">"but no stored SV"</span>
-<a name="382" href="#382">382</a>                         );
-<a name="383" href="#383">383</a>                     }
-<a name="384" href="#384">384</a>                 } <strong class="jxr_keyword">else</strong> {
-<a name="385" href="#385">385</a>                     <em class="jxr_comment">//If we have stored signature values</em>
-<a name="386" href="#386">386</a>                     <strong class="jxr_keyword">boolean</strong> found = false;
-<a name="387" href="#387">387</a>                     <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> ii = 0; ii &lt; sigv.size(); ii++) {
-<a name="388" href="#388">388</a>                         byte[] storedValue = (byte[]) sigv.get(ii);
-<a name="389" href="#389">389</a>                         <strong class="jxr_keyword">if</strong> (Arrays.equals(sigVal, storedValue)) {
-<a name="390" href="#390">390</a>                             found = <strong class="jxr_keyword">true</strong>;
-<a name="391" href="#391">391</a>                             sigv.remove(ii);
-<a name="392" href="#392">392</a>                             <strong class="jxr_keyword">break</strong>;
-<a name="393" href="#393">393</a>                         }
-<a name="394" href="#394">394</a>                     }
-<a name="395" href="#395">395</a>                     <strong class="jxr_keyword">if</strong> (!found) {
-<a name="396" href="#396">396</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="397" href="#397">397</a>                             <span class="jxr_string">"WSHandler: Check Signature confirmation: got SC element, "</span>
-<a name="398" href="#398">398</a>                             + <span class="jxr_string">"but no matching SV"</span>
-<a name="399" href="#399">399</a>                         );
-<a name="400" href="#400">400</a>                     } 
-<a name="401" href="#401">401</a>                 }
-<a name="402" href="#402">402</a>             }
-<a name="403" href="#403">403</a>         }
-<a name="404" href="#404">404</a> 
-<a name="405" href="#405">405</a>         <em class="jxr_comment">/*</em>
-<a name="406" href="#406">406</a> <em class="jxr_comment">         * This indicates this is the last handler: the vector holding the</em>
-<a name="407" href="#407">407</a> <em class="jxr_comment">         * stored Signature values must be empty, otherwise we have an error</em>
-<a name="408" href="#408">408</a> <em class="jxr_comment">         */</em>
-<a name="409" href="#409">409</a>         <strong class="jxr_keyword">if</strong> (!reqData.isNoSerialization()) {
-<a name="410" href="#410">410</a>             log.debug(<span class="jxr_string">"Check Signature confirmation - last handler"</span>);
-<a name="411" href="#411">411</a>             <strong class="jxr_keyword">if</strong> (sigv != <strong class="jxr_keyword">null</strong> &amp;&amp; !sigv.isEmpty()) {
-<a name="412" href="#412">412</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="413" href="#413">413</a>                     <span class="jxr_string">"WSHandler: Check Signature confirmation: stored SV vector not empty"</span>
-<a name="414" href="#414">414</a>                 );
-<a name="415" href="#415">415</a>             }
-<a name="416" href="#416">416</a>         }
-<a name="417" href="#417">417</a>     }
-<a name="418" href="#418">418</a>     
-<a name="419" href="#419">419</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="420" href="#420">420</a> <em class="jxr_javadoccomment">     * Hook to allow subclasses to load their Signature Crypto however they see</em>
-<a name="421" href="#421">421</a> <em class="jxr_javadoccomment">     * fit.</em>
-<a name="422" href="#422">422</a> <em class="jxr_javadoccomment">     */</em>
-<a name="423" href="#423">423</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> loadSignatureCrypto(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
-<a name="424" href="#424">424</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="425" href="#425">425</a>         <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> crypto = <strong class="jxr_keyword">null</strong>;
-<a name="426" href="#426">426</a>         <em class="jxr_comment">/*</em>
-<a name="427" href="#427">427</a> <em class="jxr_comment">         * Get crypto property file for signature. If none specified throw</em>
-<a name="428" href="#428">428</a> <em class="jxr_comment">         * fault, otherwise get a crypto instance.</em>
-<a name="429" href="#429">429</a> <em class="jxr_comment">         */</em>
-<a name="430" href="#430">430</a>         String sigPropFile = 
-<a name="431" href="#431">431</a>             getString(WSHandlerConstants.SIG_PROP_FILE, reqData.getMsgContext());
-<a name="432" href="#432">432</a>         <strong class="jxr_keyword">if</strong> (sigPropFile != <strong class="jxr_keyword">null</strong>) {
-<a name="433" href="#433">433</a>             crypto = (Crypto) cryptos.get(sigPropFile);
-<a name="434" href="#434">434</a>             <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
-<a name="435" href="#435">435</a>                 crypto = 
-<a name="436" href="#436">436</a>                     CryptoFactory.getInstance(
-<a name="437" href="#437">437</a>                         sigPropFile, <strong class="jxr_keyword">this</strong>.getClassLoader(reqData.getMsgContext())
-<a name="438" href="#438">438</a>                     );
-<a name="439" href="#439">439</a>                 cryptos.put(sigPropFile, crypto);
-<a name="440" href="#440">440</a>             }
-<a name="441" href="#441">441</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (getString(WSHandlerConstants.SIG_PROP_REF_ID, reqData.getMsgContext()) != <strong class="jxr_keyword">null</strong>) {
-<a name="442" href="#442">442</a>             <em class="jxr_comment">//</em>
-<a name="443" href="#443">443</a>             <em class="jxr_comment">// If the property file is missing then look for the Properties object </em>
+<a name="253" href="#253">253</a> 
+<a name="254" href="#254">254</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> doReceiverAction(<strong class="jxr_keyword">int</strong> doAction, <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData)
+<a name="255" href="#255">255</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="256" href="#256">256</a> 
+<a name="257" href="#257">257</a>         <a href="../../../../../org/apache/ws/security/WSSConfig.html">WSSConfig</a> wssConfig = reqData.getWssConfig();
+<a name="258" href="#258">258</a>         <strong class="jxr_keyword">if</strong> (wssConfig == <strong class="jxr_keyword">null</strong>) {
+<a name="259" href="#259">259</a>             wssConfig = secEngine.getWssConfig();
+<a name="260" href="#260">260</a>         }
+<a name="261" href="#261">261</a>         <strong class="jxr_keyword">boolean</strong> enableSigConf = decodeEnableSignatureConfirmation(reqData);
+<a name="262" href="#262">262</a>         wssConfig.setEnableSignatureConfirmation(
+<a name="263" href="#263">263</a>             enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
+<a name="264" href="#264">264</a>         );
+<a name="265" href="#265">265</a>         wssConfig.setTimeStampStrict(decodeTimestampStrict(reqData));
+<a name="266" href="#266">266</a>         wssConfig.setHandleCustomPasswordTypes(decodeCustomPasswordTypes(reqData));
+<a name="267" href="#267">267</a>         wssConfig.setPasswordsAreEncoded(decodeUseEncodedPasswords(reqData));
+<a name="268" href="#268">268</a>         wssConfig.setAllowNamespaceQualifiedPasswordTypes(
+<a name="269" href="#269">269</a>             decodeNamespaceQualifiedPasswordTypes(reqData)
+<a name="270" href="#270">270</a>         );
+<a name="271" href="#271">271</a>         wssConfig.setSecretKeyLength(reqData.getSecretKeyLength());
+<a name="272" href="#272">272</a>         reqData.setWssConfig(wssConfig);
+<a name="273" href="#273">273</a> 
+<a name="274" href="#274">274</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.SIGN) == WSConstants.SIGN) {
+<a name="275" href="#275">275</a>             decodeSignatureParameter2(reqData);
+<a name="276" href="#276">276</a>         }
+<a name="277" href="#277">277</a>         
+<a name="278" href="#278">278</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED) {
+<a name="279" href="#279">279</a>             decodeSignatureParameter2(reqData);
+<a name="280" href="#280">280</a>         }
+<a name="281" href="#281">281</a>         
+<a name="282" href="#282">282</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
+<a name="283" href="#283">283</a>             decodeDecryptionParameter(reqData);
+<a name="284" href="#284">284</a>         }
+<a name="285" href="#285">285</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.NO_SERIALIZE) == WSConstants.NO_SERIALIZE) {
+<a name="286" href="#286">286</a>             reqData.setNoSerialization(<strong class="jxr_keyword">true</strong>);
+<a name="287" href="#287">287</a>         }
+<a name="288" href="#288">288</a>     }
+<a name="289" href="#289">289</a> 
+<a name="290" href="#290">290</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResults(Vector wsResult, Vector actions) {
+<a name="291" href="#291">291</a>         <strong class="jxr_keyword">int</strong> resultActions = wsResult.size();
+<a name="292" href="#292">292</a>         <strong class="jxr_keyword">int</strong> size = actions.size();
+<a name="293" href="#293">293</a> 
+<a name="294" href="#294">294</a>         <strong class="jxr_keyword">int</strong> ai = 0;
+<a name="295" href="#295">295</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; resultActions; i++) {
+<a name="296" href="#296">296</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) ((WSSecurityEngineResult) wsResult
+<a name="297" href="#297">297</a>                     .get(i)).get(WSSecurityEngineResult.TAG_ACTION);
+<a name="298" href="#298">298</a>             <strong class="jxr_keyword">int</strong> act = actInt.intValue();
+<a name="299" href="#299">299</a>             <strong class="jxr_keyword">if</strong> (act == WSConstants.SC || act == WSConstants.BST) {
+<a name="300" href="#300">300</a>                 <strong class="jxr_keyword">continue</strong>;
+<a name="301" href="#301">301</a>             }
+<a name="302" href="#302">302</a>             <strong class="jxr_keyword">if</strong> (ai &gt;= size || ((Integer) actions.get(ai++)).intValue() != act) {
+<a name="303" href="#303">303</a>                 <strong class="jxr_keyword">return</strong> false;
+<a name="304" href="#304">304</a>             }
+<a name="305" href="#305">305</a>         }
+<a name="306" href="#306">306</a> 
+<a name="307" href="#307">307</a>         <strong class="jxr_keyword">if</strong> (ai != size) {
+<a name="308" href="#308">308</a>             <strong class="jxr_keyword">return</strong> false;
+<a name="309" href="#309">309</a>         }
+<a name="310" href="#310">310</a> 
+<a name="311" href="#311">311</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a name="312" href="#312">312</a>     }
+<a name="313" href="#313">313</a>     
+<a name="314" href="#314">314</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResultsAnyOrder(Vector wsResult, Vector actions) {
+<a name="315" href="#315">315</a> 
+<a name="316" href="#316">316</a>         java.util.List recordedActions = <strong class="jxr_keyword">new</strong> Vector(actions.size());
+<a name="317" href="#317">317</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; actions.size(); i++) {
+<a name="318" href="#318">318</a>             Integer action = (Integer)actions.get(i);
+<a name="319" href="#319">319</a>             recordedActions.add(action);
+<a name="320" href="#320">320</a>         }
+<a name="321" href="#321">321</a>         
+<a name="322" href="#322">322</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; wsResult.size(); i++) {
+<a name="323" href="#323">323</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) ((WSSecurityEngineResult) wsResult
+<a name="324" href="#324">324</a>                     .get(i)).get(WSSecurityEngineResult.TAG_ACTION);
+<a name="325" href="#325">325</a>             <strong class="jxr_keyword">int</strong> act = actInt.intValue();
+<a name="326" href="#326">326</a>             <strong class="jxr_keyword">if</strong> (act == WSConstants.SC || act == WSConstants.BST) {
+<a name="327" href="#327">327</a>                 <strong class="jxr_keyword">continue</strong>;
+<a name="328" href="#328">328</a>             }
+<a name="329" href="#329">329</a>             
+<a name="330" href="#330">330</a>             <strong class="jxr_keyword">if</strong> (!recordedActions.remove(actInt)) {
+<a name="331" href="#331">331</a>                 <strong class="jxr_keyword">return</strong> false;
+<a name="332" href="#332">332</a>             }
+<a name="333" href="#333">333</a>         }
+<a name="334" href="#334">334</a> 
+<a name="335" href="#335">335</a>         <strong class="jxr_keyword">if</strong> (!recordedActions.isEmpty()) {
+<a name="336" href="#336">336</a>             <strong class="jxr_keyword">return</strong> false;
+<a name="337" href="#337">337</a>         }
+<a name="338" href="#338">338</a> 
+<a name="339" href="#339">339</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a name="340" href="#340">340</a>     }
+<a name="341" href="#341">341</a> 
+<a name="342" href="#342">342</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> checkSignatureConfirmation(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData,
+<a name="343" href="#343">343</a>             Vector wsResult) <strong class="jxr_keyword">throws</strong> WSSecurityException{
+<a name="344" href="#344">344</a>         <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="345" href="#345">345</a>             log.debug(<span class="jxr_string">"Check Signature confirmation"</span>);
+<a name="346" href="#346">346</a>         }
+<a name="347" href="#347">347</a> 
+<a name="348" href="#348">348</a>         <em class="jxr_comment">/*</em>
+<a name="349" href="#349">349</a> <em class="jxr_comment">         * First get all Signature values stored during sending the request</em>
+<a name="350" href="#350">350</a> <em class="jxr_comment">         */</em>
+<a name="351" href="#351">351</a>         Vector sigv = (Vector) getProperty(reqData.getMsgContext(),
+<a name="352" href="#352">352</a>                 WSHandlerConstants.SEND_SIGV);
+<a name="353" href="#353">353</a>         <em class="jxr_comment">/*</em>
+<a name="354" href="#354">354</a> <em class="jxr_comment">         * Now get all results that hold a SignatureConfirmation element from</em>
+<a name="355" href="#355">355</a> <em class="jxr_comment">         * the current run of receiver (we can have more than one run: if we</em>
+<a name="356" href="#356">356</a> <em class="jxr_comment">         * have several security header blocks with different actors/roles)</em>
+<a name="357" href="#357">357</a> <em class="jxr_comment">         */</em>
+<a name="358" href="#358">358</a>         Vector sigConf = <strong class="jxr_keyword">new</strong> Vector();
+<a name="359" href="#359">359</a>         WSSecurityUtil.fetchAllActionResults(wsResult, WSConstants.SC, sigConf);
+<a name="360" href="#360">360</a>         <em class="jxr_comment">/*</em>
+<a name="361" href="#361">361</a> <em class="jxr_comment">         * now loop over all SignatureConfirmation results and check:</em>
+<a name="362" href="#362">362</a> <em class="jxr_comment">         * - if there is a signature value and no Signature value generated in request: error</em>
+<a name="363" href="#363">363</a> <em class="jxr_comment">         * - if there is a signature value and no matching Signature value found: error</em>
+<a name="364" href="#364">364</a> <em class="jxr_comment">         * </em>
+<a name="365" href="#365">365</a> <em class="jxr_comment">         *  If a matching value found: remove from vector of stored signature values</em>
+<a name="366" href="#366">366</a> <em class="jxr_comment">         */</em>
+<a name="367" href="#367">367</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; sigConf.size(); i++) {
+<a name="368" href="#368">368</a>             <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result = 
+<a name="369" href="#369">369</a>                 (<a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a>)sigConf.get(i);
+<a name="370" href="#370">370</a>             <a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a> sc = 
+<a name="371" href="#371">371</a>                 (<a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a>)result.get(WSSecurityEngineResult.TAG_SIGNATURE_CONFIRMATION);
+<a name="372" href="#372">372</a> 
+<a name="373" href="#373">373</a>             byte[] sigVal = sc.getSignatureValue();
+<a name="374" href="#374">374</a>             <strong class="jxr_keyword">if</strong> (sigVal != <strong class="jxr_keyword">null</strong>) {
+<a name="375" href="#375">375</a>                 <strong class="jxr_keyword">if</strong> (sigv == <strong class="jxr_keyword">null</strong> || sigv.size() == 0) {
+<a name="376" href="#376">376</a>                     <em class="jxr_comment">// If there are no stored signature values</em>
+<a name="377" href="#377">377</a>                     <strong class="jxr_keyword">if</strong> (sigVal.length != 0) {
+<a name="378" href="#378">378</a>                         <em class="jxr_comment">// If there's no value in the case where there are no</em>
+<a name="379" href="#379">379</a>                         <em class="jxr_comment">// stored SV it is valid. Therefore if there IS a value </em>
+<a name="380" href="#380">380</a>                         <em class="jxr_comment">// in the sig confirmation element</em>
+<a name="381" href="#381">381</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="382" href="#382">382</a>                             <span class="jxr_string">"WSHandler: Check Signature confirmation: got a SC element, "</span>
+<a name="383" href="#383">383</a>                             + <span class="jxr_string">"but no stored SV"</span>
+<a name="384" href="#384">384</a>                         );
+<a name="385" href="#385">385</a>                     }
+<a name="386" href="#386">386</a>                 } <strong class="jxr_keyword">else</strong> {
+<a name="387" href="#387">387</a>                     <em class="jxr_comment">//If we have stored signature values</em>
+<a name="388" href="#388">388</a>                     <strong class="jxr_keyword">boolean</strong> found = false;
+<a name="389" href="#389">389</a>                     <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> ii = 0; ii &lt; sigv.size(); ii++) {
+<a name="390" href="#390">390</a>                         byte[] storedValue = (byte[]) sigv.get(ii);
+<a name="391" href="#391">391</a>                         <strong class="jxr_keyword">if</strong> (Arrays.equals(sigVal, storedValue)) {
+<a name="392" href="#392">392</a>                             found = <strong class="jxr_keyword">true</strong>;
+<a name="393" href="#393">393</a>                             sigv.remove(ii);
+<a name="394" href="#394">394</a>                             <strong class="jxr_keyword">break</strong>;
+<a name="395" href="#395">395</a>                         }
+<a name="396" href="#396">396</a>                     }
+<a name="397" href="#397">397</a>                     <strong class="jxr_keyword">if</strong> (!found) {
+<a name="398" href="#398">398</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="399" href="#399">399</a>                             <span class="jxr_string">"WSHandler: Check Signature confirmation: got SC element, "</span>
+<a name="400" href="#400">400</a>                             + <span class="jxr_string">"but no matching SV"</span>
+<a name="401" href="#401">401</a>                         );
+<a name="402" href="#402">402</a>                     } 
+<a name="403" href="#403">403</a>                 }
+<a name="404" href="#404">404</a>             }
+<a name="405" href="#405">405</a>         }
+<a name="406" href="#406">406</a> 
+<a name="407" href="#407">407</a>         <em class="jxr_comment">/*</em>
+<a name="408" href="#408">408</a> <em class="jxr_comment">         * This indicates this is the last handler: the vector holding the</em>
+<a name="409" href="#409">409</a> <em class="jxr_comment">         * stored Signature values must be empty, otherwise we have an error</em>
+<a name="410" href="#410">410</a> <em class="jxr_comment">         */</em>
+<a name="411" href="#411">411</a>         <strong class="jxr_keyword">if</strong> (!reqData.isNoSerialization()) {
+<a name="412" href="#412">412</a>             log.debug(<span class="jxr_string">"Check Signature confirmation - last handler"</span>);
+<a name="413" href="#413">413</a>             <strong class="jxr_keyword">if</strong> (sigv != <strong class="jxr_keyword">null</strong> &amp;&amp; !sigv.isEmpty()) {
+<a name="414" href="#414">414</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="415" href="#415">415</a>                     <span class="jxr_string">"WSHandler: Check Signature confirmation: stored SV vector not empty"</span>
+<a name="416" href="#416">416</a>                 );
+<a name="417" href="#417">417</a>             }
+<a name="418" href="#418">418</a>         }
+<a name="419" href="#419">419</a>     }
+<a name="420" href="#420">420</a>     
+<a name="421" href="#421">421</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="422" href="#422">422</a> <em class="jxr_javadoccomment">     * Hook to allow subclasses to load their Signature Crypto however they see</em>
+<a name="423" href="#423">423</a> <em class="jxr_javadoccomment">     * fit.</em>
+<a name="424" href="#424">424</a> <em class="jxr_javadoccomment">     */</em>
+<a name="425" href="#425">425</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> loadSignatureCrypto(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
+<a name="426" href="#426">426</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="427" href="#427">427</a>         <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> crypto = <strong class="jxr_keyword">null</strong>;
+<a name="428" href="#428">428</a>         <em class="jxr_comment">/*</em>
+<a name="429" href="#429">429</a> <em class="jxr_comment">         * Get crypto property file for signature. If none specified throw</em>
+<a name="430" href="#430">430</a> <em class="jxr_comment">         * fault, otherwise get a crypto instance.</em>
+<a name="431" href="#431">431</a> <em class="jxr_comment">         */</em>
+<a name="432" href="#432">432</a>         String sigPropFile = 
+<a name="433" href="#433">433</a>             getString(WSHandlerConstants.SIG_PROP_FILE, reqData.getMsgContext());
+<a name="434" href="#434">434</a>         <strong class="jxr_keyword">if</strong> (sigPropFile != <strong class="jxr_keyword">null</strong>) {
+<a name="435" href="#435">435</a>             crypto = (Crypto) cryptos.get(sigPropFile);
+<a name="436" href="#436">436</a>             <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
+<a name="437" href="#437">437</a>                 crypto = 
+<a name="438" href="#438">438</a>                     CryptoFactory.getInstance(
+<a name="439" href="#439">439</a>                         sigPropFile, <strong class="jxr_keyword">this</strong>.getClassLoader(reqData.getMsgContext())
+<a name="440" href="#440">440</a>                     );
+<a name="441" href="#441">441</a>                 cryptos.put(sigPropFile, crypto);
+<a name="442" href="#442">442</a>             }
+<a name="443" href="#443">443</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (getString(WSHandlerConstants.SIG_PROP_REF_ID, reqData.getMsgContext()) != <strong class="jxr_keyword">null</strong>) {
 <a name="444" href="#444">444</a>             <em class="jxr_comment">//</em>
-<a name="445" href="#445">445</a>             String refId = 
-<a name="446" href="#446">446</a>                 getString(WSHandlerConstants.SIG_PROP_REF_ID, reqData.getMsgContext());
-<a name="447" href="#447">447</a>             <strong class="jxr_keyword">if</strong> (refId != <strong class="jxr_keyword">null</strong>) {
-<a name="448" href="#448">448</a>                 Object propObj = getProperty(reqData.getMsgContext(), refId);
-<a name="449" href="#449">449</a>                 <strong class="jxr_keyword">if</strong> (propObj instanceof Properties) {
-<a name="450" href="#450">450</a>                     crypto = (Crypto) cryptos.get(refId);
-<a name="451" href="#451">451</a>                     <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
-<a name="452" href="#452">452</a>                         crypto = CryptoFactory.getInstance((Properties)propObj);
-<a name="453" href="#453">453</a>                         cryptos.put(refId, crypto);
-<a name="454" href="#454">454</a>                     }
-<a name="455" href="#455">455</a>                 }
-<a name="456" href="#456">456</a>             }
-<a name="457" href="#457">457</a>         }
-<a name="458" href="#458">458</a>         
-<a name="459" href="#459">459</a>         <strong class="jxr_keyword">return</strong> crypto;
-<a name="460" href="#460">460</a>     }
-<a name="461" href="#461">461</a> 
-<a name="462" href="#462">462</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="463" href="#463">463</a> <em class="jxr_javadoccomment">     * Hook to allow subclasses to load their Encryption Crypto however they</em>
-<a name="464" href="#464">464</a> <em class="jxr_javadoccomment">     * see fit.</em>
-<a name="465" href="#465">465</a> <em class="jxr_javadoccomment">     */</em>
-<a name="466" href="#466">466</a>     <strong class="jxr_keyword">protected</strong> <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> loadEncryptionCrypto(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
-<a name="467" href="#467">467</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="468" href="#468">468</a>         <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> crypto = <strong class="jxr_keyword">null</strong>;
-<a name="469" href="#469">469</a>         <em class="jxr_comment">/*</em>
-<a name="470" href="#470">470</a> <em class="jxr_comment">         * Get encryption crypto property file. If non specified take crypto</em>
-<a name="471" href="#471">471</a> <em class="jxr_comment">         * instance from signature, if that fails: throw fault</em>
-<a name="472" href="#472">472</a> <em class="jxr_comment">         */</em>
-<a name="473" href="#473">473</a>         String encPropFile = 
-<a name="474" href="#474">474</a>             getString(WSHandlerConstants.ENC_PROP_FILE, reqData.getMsgContext());
-<a name="475" href="#475">475</a>         <strong class="jxr_keyword">if</strong> (encPropFile != <strong class="jxr_keyword">null</strong>) {
-<a name="476" href="#476">476</a>             crypto = (Crypto) cryptos.get(encPropFile);
-<a name="477" href="#477">477</a>             <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
-<a name="478" href="#478">478</a>                 crypto = 
-<a name="479" href="#479">479</a>                     CryptoFactory.getInstance(
-<a name="480" href="#480">480</a>                         encPropFile, <strong class="jxr_keyword">this</strong>.getClassLoader(reqData.getMsgContext())
-<a name="481" href="#481">481</a>                     );
-<a name="482" href="#482">482</a>                 cryptos.put(encPropFile, crypto);
-<a name="483" href="#483">483</a>             }
-<a name="484" href="#484">484</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (getString(WSHandlerConstants.ENC_PROP_REF_ID, reqData.getMsgContext()) != <strong class="jxr_keyword">null</strong>) {
-<a name="485" href="#485">485</a>             <em class="jxr_comment">//</em>
-<a name="486" href="#486">486</a>             <em class="jxr_comment">// If the property file is missing then look for the Properties object </em>
+<a name="445" href="#445">445</a>             <em class="jxr_comment">// If the property file is missing then look for the Properties object </em>
+<a name="446" href="#446">446</a>             <em class="jxr_comment">//</em>
+<a name="447" href="#447">447</a>             String refId = 
+<a name="448" href="#448">448</a>                 getString(WSHandlerConstants.SIG_PROP_REF_ID, reqData.getMsgContext());
+<a name="449" href="#449">449</a>             <strong class="jxr_keyword">if</strong> (refId != <strong class="jxr_keyword">null</strong>) {
+<a name="450" href="#450">450</a>                 Object propObj = getProperty(reqData.getMsgContext(), refId);
+<a name="451" href="#451">451</a>                 <strong class="jxr_keyword">if</strong> (propObj instanceof Properties) {
+<a name="452" href="#452">452</a>                     crypto = (Crypto) cryptos.get(refId);
+<a name="453" href="#453">453</a>                     <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
+<a name="454" href="#454">454</a>                         crypto = CryptoFactory.getInstance((Properties)propObj);
+<a name="455" href="#455">455</a>                         cryptos.put(refId, crypto);
+<a name="456" href="#456">456</a>                     }
+<a name="457" href="#457">457</a>                 }
+<a name="458" href="#458">458</a>             }
+<a name="459" href="#459">459</a>         }
+<a name="460" href="#460">460</a>         
+<a name="461" href="#461">461</a>         <strong class="jxr_keyword">return</strong> crypto;
+<a name="462" href="#462">462</a>     }
+<a name="463" href="#463">463</a> 
+<a name="464" href="#464">464</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="465" href="#465">465</a> <em class="jxr_javadoccomment">     * Hook to allow subclasses to load their Encryption Crypto however they</em>
+<a name="466" href="#466">466</a> <em class="jxr_javadoccomment">     * see fit.</em>
+<a name="467" href="#467">467</a> <em class="jxr_javadoccomment">     */</em>
+<a name="468" href="#468">468</a>     <strong class="jxr_keyword">protected</strong> <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> loadEncryptionCrypto(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
+<a name="469" href="#469">469</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="470" href="#470">470</a>         <a href="../../../../../org/apache/ws/security/components/crypto/Crypto.html">Crypto</a> crypto = <strong class="jxr_keyword">null</strong>;
+<a name="471" href="#471">471</a>         <em class="jxr_comment">/*</em>
+<a name="472" href="#472">472</a> <em class="jxr_comment">         * Get encryption crypto property file. If non specified take crypto</em>
+<a name="473" href="#473">473</a> <em class="jxr_comment">         * instance from signature, if that fails: throw fault</em>
+<a name="474" href="#474">474</a> <em class="jxr_comment">         */</em>
+<a name="475" href="#475">475</a>         String encPropFile = 
+<a name="476" href="#476">476</a>             getString(WSHandlerConstants.ENC_PROP_FILE, reqData.getMsgContext());
+<a name="477" href="#477">477</a>         <strong class="jxr_keyword">if</strong> (encPropFile != <strong class="jxr_keyword">null</strong>) {
+<a name="478" href="#478">478</a>             crypto = (Crypto) cryptos.get(encPropFile);
+<a name="479" href="#479">479</a>             <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
+<a name="480" href="#480">480</a>                 crypto = 
+<a name="481" href="#481">481</a>                     CryptoFactory.getInstance(
+<a name="482" href="#482">482</a>                         encPropFile, <strong class="jxr_keyword">this</strong>.getClassLoader(reqData.getMsgContext())
+<a name="483" href="#483">483</a>                     );
+<a name="484" href="#484">484</a>                 cryptos.put(encPropFile, crypto);
+<a name="485" href="#485">485</a>             }
+<a name="486" href="#486">486</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (getString(WSHandlerConstants.ENC_PROP_REF_ID, reqData.getMsgContext()) != <strong class="jxr_keyword">null</strong>) {
 <a name="487" href="#487">487</a>             <em class="jxr_comment">//</em>
-<a name="488" href="#488">488</a>             String refId = 
-<a name="489" href="#489">489</a>                 getString(WSHandlerConstants.ENC_PROP_REF_ID, reqData.getMsgContext());
-<a name="490" href="#490">490</a>             <strong class="jxr_keyword">if</strong> (refId != <strong class="jxr_keyword">null</strong>) {
-<a name="491" href="#491">491</a>                 Object propObj = getProperty(reqData.getMsgContext(), refId);
-<a name="492" href="#492">492</a>                 <strong class="jxr_keyword">if</strong> (propObj instanceof Properties) {
-<a name="493" href="#493">493</a>                     crypto = (Crypto) cryptos.get(refId);
-<a name="494" href="#494">494</a>                     <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
-<a name="495" href="#495">495</a>                         crypto = CryptoFactory.getInstance((Properties)propObj);
-<a name="496" href="#496">496</a>                         cryptos.put(refId, crypto);
-<a name="497" href="#497">497</a>                     }
-<a name="498" href="#498">498</a>                 }
-<a name="499" href="#499">499</a>             }
-<a name="500" href="#500">500</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (reqData.getSigCrypto() != <strong class="jxr_keyword">null</strong>) {
-<a name="501" href="#501">501</a>             <em class="jxr_comment">//</em>
-<a name="502" href="#502">502</a>             <em class="jxr_comment">// Default to the signature crypto</em>
+<a name="488" href="#488">488</a>             <em class="jxr_comment">// If the property file is missing then look for the Properties object </em>
+<a name="489" href="#489">489</a>             <em class="jxr_comment">//</em>
+<a name="490" href="#490">490</a>             String refId = 
+<a name="491" href="#491">491</a>                 getString(WSHandlerConstants.ENC_PROP_REF_ID, reqData.getMsgContext());
+<a name="492" href="#492">492</a>             <strong class="jxr_keyword">if</strong> (refId != <strong class="jxr_keyword">null</strong>) {
+<a name="493" href="#493">493</a>                 Object propObj = getProperty(reqData.getMsgContext(), refId);
+<a name="494" href="#494">494</a>                 <strong class="jxr_keyword">if</strong> (propObj instanceof Properties) {
+<a name="495" href="#495">495</a>                     crypto = (Crypto) cryptos.get(refId);
+<a name="496" href="#496">496</a>                     <strong class="jxr_keyword">if</strong> (crypto == <strong class="jxr_keyword">null</strong>) {
+<a name="497" href="#497">497</a>                         crypto = CryptoFactory.getInstance((Properties)propObj);
+<a name="498" href="#498">498</a>                         cryptos.put(refId, crypto);
+<a name="499" href="#499">499</a>                     }
+<a name="500" href="#500">500</a>                 }
+<a name="501" href="#501">501</a>             }
+<a name="502" href="#502">502</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (reqData.getSigCrypto() != <strong class="jxr_keyword">null</strong>) {
 <a name="503" href="#503">503</a>             <em class="jxr_comment">//</em>
-<a name="504" href="#504">504</a>             crypto = reqData.getSigCrypto();
-<a name="505" href="#505">505</a>         }
-<a name="506" href="#506">506</a>         
-<a name="507" href="#507">507</a>         <strong class="jxr_keyword">return</strong> crypto;
-<a name="508" href="#508">508</a>     }
-<a name="509" href="#509">509</a> 
-<a name="510" href="#510">510</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> decodeUTParameter(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
-<a name="511" href="#511">511</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="512" href="#512">512</a>         Object mc = reqData.getMsgContext();
-<a name="513" href="#513">513</a> 
-<a name="514" href="#514">514</a>         String type = getString(WSHandlerConstants.PASSWORD_TYPE, mc);
-<a name="515" href="#515">515</a>         <strong class="jxr_keyword">if</strong> (type != <strong class="jxr_keyword">null</strong>) {
-<a name="516" href="#516">516</a>             <strong class="jxr_keyword">if</strong> (WSConstants.PW_TEXT.equals(type)) {
-<a name="517" href="#517">517</a>                 reqData.setPwType(WSConstants.PASSWORD_TEXT);
-<a name="518" href="#518">518</a>             } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.PW_DIGEST.equals(type)) {
-<a name="519" href="#519">519</a>                 reqData.setPwType(WSConstants.PASSWORD_DIGEST);
-<a name="520" href="#520">520</a>             } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.PW_NONE.equals(type)) {
-<a name="521" href="#521">521</a>                 <em class="jxr_comment">// No password requested.</em>
-<a name="522" href="#522">522</a>                 reqData.setPwType(<strong class="jxr_keyword">null</strong>);
-<a name="523" href="#523">523</a>             } <strong class="jxr_keyword">else</strong> {
-<a name="524" href="#524">524</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(<span class="jxr_string">"Unknown password type encoding: "</span> + type);
-<a name="525" href="#525">525</a>             }
-<a name="526" href="#526">526</a>         }
-<a name="527" href="#527">527</a> 
-<a name="528" href="#528">528</a>         String add = getString(WSHandlerConstants.ADD_UT_ELEMENTS, mc);
-<a name="529" href="#529">529</a>         <strong class="jxr_keyword">if</strong> (add != <strong class="jxr_keyword">null</strong>) {
-<a name="530" href="#530">530</a>             reqData.setUtElements(StringUtil.split(add, ' '));
-<a name="531" href="#531">531</a>         }
-<a name="532" href="#532">532</a>         
-<a name="533" href="#533">533</a>         String derived = getString(WSHandlerConstants.USE_DERIVED_KEY, mc);
-<a name="534" href="#534">534</a>         <strong class="jxr_keyword">boolean</strong> useDerivedKey = Boolean.valueOf(derived).booleanValue();
-<a name="535" href="#535">535</a>         <strong class="jxr_keyword">if</strong> (useDerivedKey) {
-<a name="536" href="#536">536</a>             reqData.setUseDerivedKey(useDerivedKey);
-<a name="537" href="#537">537</a>         }
-<a name="538" href="#538">538</a>         
-<a name="539" href="#539">539</a>         String derivedMAC = getString(WSHandlerConstants.USE_DERIVED_KEY, mc);
-<a name="540" href="#540">540</a>         <strong class="jxr_keyword">boolean</strong> useDerivedKeyForMAC = Boolean.valueOf(derivedMAC).booleanValue();
-<a name="541" href="#541">541</a>         <strong class="jxr_keyword">if</strong> (useDerivedKeyForMAC) {
-<a name="542" href="#542">542</a>             reqData.setUseDerivedKeyForMAC(useDerivedKeyForMAC);
-<a name="543" href="#543">543</a>         }
-<a name="544" href="#544">544</a>         
-<a name="545" href="#545">545</a>         String iterations = getString(WSHandlerConstants.DERIVED_KEY_ITERATIONS, mc);
-<a name="546" href="#546">546</a>         <strong class="jxr_keyword">if</strong> (iterations != <strong class="jxr_keyword">null</strong>) {
-<a name="547" href="#547">547</a>             <strong class="jxr_keyword">int</strong> iIterations = Integer.parseInt(iterations);
-<a name="548" href="#548">548</a>             reqData.setDerivedKeyIterations(iIterations);
-<a name="549" href="#549">549</a>         }
-<a name="550" href="#550">550</a>     }
-<a name="551" href="#551">551</a> 
-<a name="552" href="#552">552</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> decodeSignatureParameter(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
-<a name="553" href="#553">553</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="554" href="#554">554</a>         Object mc = reqData.getMsgContext();
-<a name="555" href="#555">555</a>         String signatureUser = getString(WSHandlerConstants.SIGNATURE_USER, mc);
-<a name="556" href="#556">556</a> 
-<a name="557" href="#557">557</a>         <strong class="jxr_keyword">if</strong> (signatureUser != <strong class="jxr_keyword">null</strong>) {
-<a name="558" href="#558">558</a>             reqData.setSignatureUser(signatureUser);
-<a name="559" href="#559">559</a>         } <strong class="jxr_keyword">else</strong> {
-<a name="560" href="#560">560</a>             reqData.setSignatureUser(reqData.getUsername());
-<a name="561" href="#561">561</a>         }
-<a name="562" href="#562">562</a>         
-<a name="563" href="#563">563</a>         String keyId = getString(WSHandlerConstants.SIG_KEY_ID, mc);
-<a name="564" href="#564">564</a>         <strong class="jxr_keyword">if</strong> (keyId != <strong class="jxr_keyword">null</strong>) {
-<a name="565" href="#565">565</a>             Integer id = (Integer) WSHandlerConstants.keyIdentifier.get(keyId);
-<a name="566" href="#566">566</a>             <strong class="jxr_keyword">if</strong> (id == <strong class="jxr_keyword">null</strong>) {
-<a name="567" href="#567">567</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="568" href="#568">568</a>                     <span class="jxr_string">"WSHandler: Signature: unknown key identification"</span>
-<a name="569" href="#569">569</a>                 );
-<a name="570" href="#570">570</a>             }
-<a name="571" href="#571">571</a>             <strong class="jxr_keyword">int</strong> tmp = id.intValue();
-<a name="572" href="#572">572</a>             <strong class="jxr_keyword">if</strong> (!(tmp == WSConstants.ISSUER_SERIAL
-<a name="573" href="#573">573</a>                     || tmp == WSConstants.BST_DIRECT_REFERENCE
-<a name="574" href="#574">574</a>                     || tmp == WSConstants.X509_KEY_IDENTIFIER
-<a name="575" href="#575">575</a>                     || tmp == WSConstants.SKI_KEY_IDENTIFIER
-<a name="576" href="#576">576</a>                     || tmp == WSConstants.THUMBPRINT_IDENTIFIER
-<a name="577" href="#577">577</a>                     || tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER)) {

[... 1829 lines stripped ...]


Mime
View raw message