You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2012/07/31 18:30:30 UTC

svn commit: r1367668 [25/32] - in /webservices/wss4j/site: ./ apidocs/ apidocs/org/apache/ws/security/ apidocs/org/apache/ws/security/action/ apidocs/org/apache/ws/security/action/class-use/ apidocs/org/apache/ws/security/cache/ apidocs/org/apache/ws/s...

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=1367668&r1=1367667&r2=1367668&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 Jul 31 16:30:10 2012
@@ -52,1146 +52,1168 @@
 <a name="42" href="#42">42</a>  <strong class="jxr_keyword">import</strong> java.security.cert.X509Certificate;
 <a name="43" href="#43">43</a>  <strong class="jxr_keyword">import</strong> java.util.Arrays;
 <a name="44" href="#44">44</a>  <strong class="jxr_keyword">import</strong> java.util.ArrayList;
-<a name="45" href="#45">45</a>  <strong class="jxr_keyword">import</strong> java.util.HashMap;
-<a name="46" href="#46">46</a>  <strong class="jxr_keyword">import</strong> java.util.List;
-<a name="47" href="#47">47</a>  <strong class="jxr_keyword">import</strong> java.util.Map;
-<a name="48" href="#48">48</a>  <strong class="jxr_keyword">import</strong> java.util.Properties;
-<a name="49" href="#49">49</a>  
-<a name="50" href="#50">50</a>  
-<a name="51" href="#51">51</a>  <em class="jxr_javadoccomment">/**</em>
-<a name="52" href="#52">52</a>  <em class="jxr_javadoccomment"> * Extracted from WSDoAllReceiver and WSDoAllSender</em>
-<a name="53" href="#53">53</a>  <em class="jxr_javadoccomment"> * Extended to all passwordless UsernameTokens and configurable identities.</em>
-<a name="54" href="#54">54</a>  <em class="jxr_javadoccomment"> *</em>
-<a name="55" href="#55">55</a>  <em class="jxr_javadoccomment"> * @author Davanum Srinivas (dims@yahoo.com).</em>
-<a name="56" href="#56">56</a>  <em class="jxr_javadoccomment"> * @author Werner Dittmann (Werner.Dittmann@t-online.de).</em>
-<a name="57" href="#57">57</a>  <em class="jxr_javadoccomment"> * @author Marcel Ammerlaan (marcel.ammerlaan@gmail.com).</em>
-<a name="58" href="#58">58</a>  <em class="jxr_javadoccomment"> */</em>
-<a name="59" href="#59">59</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/ws/security/handler/WSHandler.html">WSHandler</a> {
-<a name="60" href="#60">60</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> org.apache.commons.logging.Log log = 
-<a name="61" href="#61">61</a>          org.apache.commons.logging.LogFactory.getLog(WSHandler.<strong class="jxr_keyword">class</strong>);
-<a name="62" href="#62">62</a>      <strong class="jxr_keyword">protected</strong> <a href="../../../../../org/apache/ws/security/WSSecurityEngine.html">WSSecurityEngine</a> secEngine = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityEngine.html">WSSecurityEngine</a>();
-<a name="63" href="#63">63</a>      <strong class="jxr_keyword">protected</strong> Map&lt;String, Crypto&gt; cryptos = <strong class="jxr_keyword">new</strong> HashMap&lt;String, Crypto&gt;();
-<a name="64" href="#64">64</a>  
-<a name="65" href="#65">65</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> doDebug = log.isDebugEnabled();
-<a name="66" href="#66">66</a>  
-<a name="67" href="#67">67</a>      <em class="jxr_javadoccomment">/**</em><em class="jxr_javadoccomment">                                                             </em>
-<a name="68" href="#68">68</a>  <em class="jxr_javadoccomment">     * Performs all defined security actions to set-up the SOAP request.</em>
-<a name="69" href="#69">69</a>  <em class="jxr_javadoccomment">     * </em>
-<a name="70" href="#70">70</a>  <em class="jxr_javadoccomment">     * </em>
-<a name="71" href="#71">71</a>  <em class="jxr_javadoccomment">     * @param doAction a set defining the actions to do </em>
-<a name="72" href="#72">72</a>  <em class="jxr_javadoccomment">     * @param doc   the request as DOM document </em>
-<a name="73" href="#73">73</a>  <em class="jxr_javadoccomment">     * @param reqData a data storage to pass values around between methods</em>
-<a name="74" href="#74">74</a>  <em class="jxr_javadoccomment">     * @param actions a list holding the actions to do in the order defined</em>
-<a name="75" href="#75">75</a>  <em class="jxr_javadoccomment">     *                in the deployment file or property</em>
-<a name="76" href="#76">76</a>  <em class="jxr_javadoccomment">     * @throws WSSecurityException</em>
-<a name="77" href="#77">77</a>  <em class="jxr_javadoccomment">     */</em>
-<a name="78" href="#78">78</a>      @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
-<a name="79" href="#79">79</a>      <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> doSenderAction(
-<a name="80" href="#80">80</a>              <strong class="jxr_keyword">int</strong> doAction, 
-<a name="81" href="#81">81</a>              Document doc,
-<a name="82" href="#82">82</a>              <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData, 
-<a name="83" href="#83">83</a>              List&lt;Integer&gt; actions, 
-<a name="84" href="#84">84</a>              <strong class="jxr_keyword">boolean</strong> isRequest
-<a name="85" href="#85">85</a>      ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="86" href="#86">86</a>  
-<a name="87" href="#87">87</a>          <strong class="jxr_keyword">boolean</strong> mu = decodeMustUnderstand(reqData);
-<a name="88" href="#88">88</a>  
-<a name="89" href="#89">89</a>          <a href="../../../../../org/apache/ws/security/WSSConfig.html">WSSConfig</a> wssConfig = reqData.getWssConfig();
-<a name="90" href="#90">90</a>          <strong class="jxr_keyword">if</strong> (wssConfig == <strong class="jxr_keyword">null</strong>) {
-<a name="91" href="#91">91</a>              wssConfig = secEngine.getWssConfig();
-<a name="92" href="#92">92</a>          }
-<a name="93" href="#93">93</a>  
-<a name="94" href="#94">94</a>          <strong class="jxr_keyword">boolean</strong> enableSigConf = decodeEnableSignatureConfirmation(reqData);
-<a name="95" href="#95">95</a>          wssConfig.setEnableSignatureConfirmation(
-<a name="96" href="#96">96</a>              enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
-<a name="97" href="#97">97</a>          );
-<a name="98" href="#98">98</a>          wssConfig.setPasswordsAreEncoded(decodeUseEncodedPasswords(reqData));
-<a name="99" href="#99">99</a>  
-<a name="100" href="#100">100</a>         wssConfig.setPrecisionInMilliSeconds(
-<a name="101" href="#101">101</a>             decodeTimestampPrecision(reqData)
-<a name="102" href="#102">102</a>         );
-<a name="103" href="#103">103</a>         reqData.setWssConfig(wssConfig);
-<a name="104" href="#104">104</a> 
-<a name="105" href="#105">105</a>         Object mc = reqData.getMsgContext();
-<a name="106" href="#106">106</a>         String actor = getString(WSHandlerConstants.ACTOR, mc);
-<a name="107" href="#107">107</a>         reqData.setActor(actor);
-<a name="108" href="#108">108</a> 
-<a name="109" href="#109">109</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="110" href="#110">110</a>         secHeader.insertSecurityHeader(doc);
+<a name="45" href="#45">45</a>  <strong class="jxr_keyword">import</strong> java.util.Collection;
+<a name="46" href="#46">46</a>  <strong class="jxr_keyword">import</strong> java.util.HashMap;
+<a name="47" href="#47">47</a>  <strong class="jxr_keyword">import</strong> java.util.List;
+<a name="48" href="#48">48</a>  <strong class="jxr_keyword">import</strong> java.util.Map;
+<a name="49" href="#49">49</a>  <strong class="jxr_keyword">import</strong> java.util.Properties;
+<a name="50" href="#50">50</a>  <strong class="jxr_keyword">import</strong> java.util.regex.Pattern;
+<a name="51" href="#51">51</a>  <strong class="jxr_keyword">import</strong> java.util.regex.PatternSyntaxException;
+<a name="52" href="#52">52</a>  
+<a name="53" href="#53">53</a>  
+<a name="54" href="#54">54</a>  <em class="jxr_javadoccomment">/**</em>
+<a name="55" href="#55">55</a>  <em class="jxr_javadoccomment"> * Extracted from WSDoAllReceiver and WSDoAllSender</em>
+<a name="56" href="#56">56</a>  <em class="jxr_javadoccomment"> * Extended to all passwordless UsernameTokens and configurable identities.</em>
+<a name="57" href="#57">57</a>  <em class="jxr_javadoccomment"> *</em>
+<a name="58" href="#58">58</a>  <em class="jxr_javadoccomment"> * @author Davanum Srinivas (dims@yahoo.com).</em>
+<a name="59" href="#59">59</a>  <em class="jxr_javadoccomment"> * @author Werner Dittmann (Werner.Dittmann@t-online.de).</em>
+<a name="60" href="#60">60</a>  <em class="jxr_javadoccomment"> * @author Marcel Ammerlaan (marcel.ammerlaan@gmail.com).</em>
+<a name="61" href="#61">61</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="62" href="#62">62</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/ws/security/handler/WSHandler.html">WSHandler</a> {
+<a name="63" href="#63">63</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> org.apache.commons.logging.Log log = 
+<a name="64" href="#64">64</a>          org.apache.commons.logging.LogFactory.getLog(WSHandler.<strong class="jxr_keyword">class</strong>);
+<a name="65" href="#65">65</a>      <strong class="jxr_keyword">protected</strong> <a href="../../../../../org/apache/ws/security/WSSecurityEngine.html">WSSecurityEngine</a> secEngine = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityEngine.html">WSSecurityEngine</a>();
+<a name="66" href="#66">66</a>      <strong class="jxr_keyword">protected</strong> Map&lt;String, Crypto&gt; cryptos = <strong class="jxr_keyword">new</strong> HashMap&lt;String, Crypto&gt;();
+<a name="67" href="#67">67</a>  
+<a name="68" href="#68">68</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> doDebug = log.isDebugEnabled();
+<a name="69" href="#69">69</a>  
+<a name="70" href="#70">70</a>      <em class="jxr_javadoccomment">/**</em><em class="jxr_javadoccomment">                                                             </em>
+<a name="71" href="#71">71</a>  <em class="jxr_javadoccomment">     * Performs all defined security actions to set-up the SOAP request.</em>
+<a name="72" href="#72">72</a>  <em class="jxr_javadoccomment">     * </em>
+<a name="73" href="#73">73</a>  <em class="jxr_javadoccomment">     * </em>
+<a name="74" href="#74">74</a>  <em class="jxr_javadoccomment">     * @param doAction a set defining the actions to do </em>
+<a name="75" href="#75">75</a>  <em class="jxr_javadoccomment">     * @param doc   the request as DOM document </em>
+<a name="76" href="#76">76</a>  <em class="jxr_javadoccomment">     * @param reqData a data storage to pass values around between methods</em>
+<a name="77" href="#77">77</a>  <em class="jxr_javadoccomment">     * @param actions a list holding the actions to do in the order defined</em>
+<a name="78" href="#78">78</a>  <em class="jxr_javadoccomment">     *                in the deployment file or property</em>
+<a name="79" href="#79">79</a>  <em class="jxr_javadoccomment">     * @throws WSSecurityException</em>
+<a name="80" href="#80">80</a>  <em class="jxr_javadoccomment">     */</em>
+<a name="81" href="#81">81</a>      @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
+<a name="82" href="#82">82</a>      <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> doSenderAction(
+<a name="83" href="#83">83</a>              <strong class="jxr_keyword">int</strong> doAction, 
+<a name="84" href="#84">84</a>              Document doc,
+<a name="85" href="#85">85</a>              <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData, 
+<a name="86" href="#86">86</a>              List&lt;Integer&gt; actions, 
+<a name="87" href="#87">87</a>              <strong class="jxr_keyword">boolean</strong> isRequest
+<a name="88" href="#88">88</a>      ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>          <strong class="jxr_keyword">boolean</strong> mu = decodeMustUnderstand(reqData);
+<a name="91" href="#91">91</a>  
+<a name="92" href="#92">92</a>          <a href="../../../../../org/apache/ws/security/WSSConfig.html">WSSConfig</a> wssConfig = reqData.getWssConfig();
+<a name="93" href="#93">93</a>          <strong class="jxr_keyword">if</strong> (wssConfig == <strong class="jxr_keyword">null</strong>) {
+<a name="94" href="#94">94</a>              wssConfig = secEngine.getWssConfig();
+<a name="95" href="#95">95</a>          }
+<a name="96" href="#96">96</a>  
+<a name="97" href="#97">97</a>          <strong class="jxr_keyword">boolean</strong> enableSigConf = decodeEnableSignatureConfirmation(reqData);
+<a name="98" href="#98">98</a>          wssConfig.setEnableSignatureConfirmation(
+<a name="99" href="#99">99</a>              enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
+<a name="100" href="#100">100</a>         );
+<a name="101" href="#101">101</a>         wssConfig.setPasswordsAreEncoded(decodeUseEncodedPasswords(reqData));
+<a name="102" href="#102">102</a> 
+<a name="103" href="#103">103</a>         wssConfig.setPrecisionInMilliSeconds(
+<a name="104" href="#104">104</a>             decodeTimestampPrecision(reqData)
+<a name="105" href="#105">105</a>         );
+<a name="106" href="#106">106</a>         reqData.setWssConfig(wssConfig);
+<a name="107" href="#107">107</a> 
+<a name="108" href="#108">108</a>         Object mc = reqData.getMsgContext();
+<a name="109" href="#109">109</a>         String actor = getString(WSHandlerConstants.ACTOR, mc);
+<a name="110" href="#110">110</a>         reqData.setActor(actor);
 <a name="111" href="#111">111</a> 
-<a name="112" href="#112">112</a>         reqData.setSecHeader(secHeader);
-<a name="113" href="#113">113</a>         reqData.setSoapConstants(
-<a name="114" href="#114">114</a>             WSSecurityUtil.getSOAPConstants(doc.getDocumentElement())
-<a name="115" href="#115">115</a>         );
-<a name="116" href="#116">116</a>         wssConfig.setWsiBSPCompliant(decodeBSPCompliance(reqData));
-<a name="117" href="#117">117</a>         <em class="jxr_comment">/*</em>
-<a name="118" href="#118">118</a> <em class="jxr_comment">         * Here we have action, username, password, and actor, mustUnderstand.</em>
-<a name="119" href="#119">119</a> <em class="jxr_comment">         * Now get the action specific parameters.</em>
-<a name="120" href="#120">120</a> <em class="jxr_comment">         */</em>
-<a name="121" href="#121">121</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.UT) == WSConstants.UT) {
-<a name="122" href="#122">122</a>             decodeUTParameter(reqData);
-<a name="123" href="#123">123</a>         }
-<a name="124" href="#124">124</a>         <em class="jxr_comment">/*</em>
-<a name="125" href="#125">125</a> <em class="jxr_comment">         * Here we have action, username, password, and actor, mustUnderstand.</em>
-<a name="126" href="#126">126</a> <em class="jxr_comment">         * Now get the action specific parameters.</em>
-<a name="127" href="#127">127</a> <em class="jxr_comment">         */</em>
-<a name="128" href="#128">128</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.UT_SIGN) == WSConstants.UT_SIGN) {
-<a name="129" href="#129">129</a>             decodeUTParameter(reqData);
-<a name="130" href="#130">130</a>             decodeSignatureParameter(reqData);
-<a name="131" href="#131">131</a>         }
-<a name="132" href="#132">132</a>         <em class="jxr_comment">/*</em>
-<a name="133" href="#133">133</a> <em class="jxr_comment">         * Get and check the Signature specific parameters first because they</em>
-<a name="134" href="#134">134</a> <em class="jxr_comment">         * may be used for encryption too.</em>
-<a name="135" href="#135">135</a> <em class="jxr_comment">         */</em>
-<a name="136" href="#136">136</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.SIGN) == WSConstants.SIGN) {
-<a name="137" href="#137">137</a>             <strong class="jxr_keyword">if</strong> (reqData.getSigCrypto() == <strong class="jxr_keyword">null</strong>) {
-<a name="138" href="#138">138</a>                 reqData.setSigCrypto(loadSignatureCrypto(reqData));
-<a name="139" href="#139">139</a>             }
-<a name="140" href="#140">140</a>             decodeSignatureParameter(reqData);
-<a name="141" href="#141">141</a>         }
-<a name="142" href="#142">142</a>         <em class="jxr_comment">/*</em>
-<a name="143" href="#143">143</a> <em class="jxr_comment">         * If we need to handle zsigned SAML token then we may need the</em>
-<a name="144" href="#144">144</a> <em class="jxr_comment">         * Signature parameters. The handle procedure loads the signature crypto</em>
-<a name="145" href="#145">145</a> <em class="jxr_comment">         * file on demand, thus don't do it here.</em>
-<a name="146" href="#146">146</a> <em class="jxr_comment">         */</em>
-<a name="147" href="#147">147</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED) {
-<a name="148" href="#148">148</a>             decodeSignatureParameter(reqData);
-<a name="149" href="#149">149</a>         }
-<a name="150" href="#150">150</a>         <em class="jxr_comment">/*</em>
-<a name="151" href="#151">151</a> <em class="jxr_comment">         * Set and check the encryption specific parameters, if necessary take</em>
-<a name="152" href="#152">152</a> <em class="jxr_comment">         * over signature parameters username and crypto instance.</em>
-<a name="153" href="#153">153</a> <em class="jxr_comment">         */</em>
-<a name="154" href="#154">154</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
-<a name="155" href="#155">155</a>             <strong class="jxr_keyword">if</strong> (reqData.getEncCrypto() == <strong class="jxr_keyword">null</strong>) {
-<a name="156" href="#156">156</a>                 reqData.setEncCrypto(loadEncryptionCrypto(reqData));
-<a name="157" href="#157">157</a>             }
-<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 SignatureConfirmation 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 = 
-<a name="180" href="#180">180</a>                 (String)getProperty(reqData.getMsgContext(), WSHandlerConstants.SIG_CONF_DONE);
-<a name="181" href="#181">181</a>             <strong class="jxr_keyword">if</strong> (done == <strong class="jxr_keyword">null</strong>) {
-<a name="182" href="#182">182</a>                 wssConfig.getAction(WSConstants.SC).execute(<strong class="jxr_keyword">this</strong>, WSConstants.SC, doc, reqData);
-<a name="183" href="#183">183</a>             }
-<a name="184" href="#184">184</a>         }
-<a name="185" href="#185">185</a>         <em class="jxr_comment">/*</em>
-<a name="186" href="#186">186</a> <em class="jxr_comment">         * Here we have all necessary information to perform the requested</em>
-<a name="187" href="#187">187</a> <em class="jxr_comment">         * action(s).</em>
-<a name="188" href="#188">188</a> <em class="jxr_comment">         */</em>
-<a name="189" href="#189">189</a>         <strong class="jxr_keyword">for</strong> (Integer actionToDo : actions) {
-<a name="190" href="#190">190</a>             <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="191" href="#191">191</a>                 log.debug(<span class="jxr_string">"Performing Action: "</span> + actionToDo);
-<a name="192" href="#192">192</a>             }
-<a name="193" href="#193">193</a> 
-<a name="194" href="#194">194</a>             <strong class="jxr_keyword">switch</strong> (actionToDo) {
-<a name="195" href="#195">195</a>             <strong class="jxr_keyword">case</strong> WSConstants.UT:
-<a name="196" href="#196">196</a>             <strong class="jxr_keyword">case</strong> WSConstants.ENCR:
-<a name="197" href="#197">197</a>             <strong class="jxr_keyword">case</strong> WSConstants.SIGN:
-<a name="198" href="#198">198</a>             <strong class="jxr_keyword">case</strong> WSConstants.ST_SIGNED:
-<a name="199" href="#199">199</a>             <strong class="jxr_keyword">case</strong> WSConstants.ST_UNSIGNED:
-<a name="200" href="#200">200</a>             <strong class="jxr_keyword">case</strong> WSConstants.TS:
-<a name="201" href="#201">201</a>             <strong class="jxr_keyword">case</strong> WSConstants.UT_SIGN:
-<a name="202" href="#202">202</a>                 wssConfig.getAction(actionToDo).execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
-<a name="203" href="#203">203</a>                 <strong class="jxr_keyword">break</strong>;
-<a name="204" href="#204">204</a>                 <em class="jxr_comment">//</em>
-<a name="205" href="#205">205</a>                 <em class="jxr_comment">// Handle any "custom" actions, similarly,</em>
-<a name="206" href="#206">206</a>                 <em class="jxr_comment">// but to preserve behavior from previous</em>
-<a name="207" href="#207">207</a>                 <em class="jxr_comment">// versions, consume (but log) action lookup failures.</em>
-<a name="208" href="#208">208</a>                 <em class="jxr_comment">//</em>
-<a name="209" href="#209">209</a>             <strong class="jxr_keyword">default</strong>:
-<a name="210" href="#210">210</a>                 <a href="../../../../../org/apache/ws/security/action/Action.html">Action</a> doit = <strong class="jxr_keyword">null</strong>;
-<a name="211" href="#211">211</a>             <strong class="jxr_keyword">try</strong> {
-<a name="212" href="#212">212</a>                 doit = wssConfig.getAction(actionToDo);
-<a name="213" href="#213">213</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> WSSecurityException e) {
-<a name="214" href="#214">214</a>                 log.warn(
-<a name="215" href="#215">215</a>                         <span class="jxr_string">"Error trying to locate a custom action ("</span> + actionToDo + <span class="jxr_string">")"</span>, 
-<a name="216" href="#216">216</a>                         e
-<a name="217" href="#217">217</a>                 );
-<a name="218" href="#218">218</a>             }
-<a name="219" href="#219">219</a>             <strong class="jxr_keyword">if</strong> (doit != <strong class="jxr_keyword">null</strong>) {
-<a name="220" href="#220">220</a>                 doit.execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
+<a name="112" href="#112">112</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="113" href="#113">113</a>         secHeader.insertSecurityHeader(doc);
+<a name="114" href="#114">114</a> 
+<a name="115" href="#115">115</a>         reqData.setSecHeader(secHeader);
+<a name="116" href="#116">116</a>         reqData.setSoapConstants(
+<a name="117" href="#117">117</a>             WSSecurityUtil.getSOAPConstants(doc.getDocumentElement())
+<a name="118" href="#118">118</a>         );
+<a name="119" href="#119">119</a>         wssConfig.setWsiBSPCompliant(decodeBSPCompliance(reqData));
+<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>             <strong class="jxr_keyword">if</strong> (reqData.getSigCrypto() == <strong class="jxr_keyword">null</strong>) {
+<a name="141" href="#141">141</a>                 reqData.setSigCrypto(loadSignatureCrypto(reqData));
+<a name="142" href="#142">142</a>             }
+<a name="143" href="#143">143</a>             decodeSignatureParameter(reqData);
+<a name="144" href="#144">144</a>         }
+<a name="145" href="#145">145</a>         <em class="jxr_comment">/*</em>
+<a name="146" href="#146">146</a> <em class="jxr_comment">         * If we need to handle zsigned SAML token then we may need the</em>
+<a name="147" href="#147">147</a> <em class="jxr_comment">         * Signature parameters. The handle procedure loads the signature crypto</em>
+<a name="148" href="#148">148</a> <em class="jxr_comment">         * file on demand, thus don't do it here.</em>
+<a name="149" href="#149">149</a> <em class="jxr_comment">         */</em>
+<a name="150" href="#150">150</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED) {
+<a name="151" href="#151">151</a>             decodeSignatureParameter(reqData);
+<a name="152" href="#152">152</a>         }
+<a name="153" href="#153">153</a>         <em class="jxr_comment">/*</em>
+<a name="154" href="#154">154</a> <em class="jxr_comment">         * Set and check the encryption specific parameters, if necessary take</em>
+<a name="155" href="#155">155</a> <em class="jxr_comment">         * over signature parameters username and crypto instance.</em>
+<a name="156" href="#156">156</a> <em class="jxr_comment">         */</em>
+<a name="157" href="#157">157</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
+<a name="158" href="#158">158</a>             <strong class="jxr_keyword">if</strong> (reqData.getEncCrypto() == <strong class="jxr_keyword">null</strong>) {
+<a name="159" href="#159">159</a>                 reqData.setEncCrypto(loadEncryptionCrypto(reqData));
+<a name="160" href="#160">160</a>             }
+<a name="161" href="#161">161</a>             decodeEncryptionParameter(reqData);
+<a name="162" href="#162">162</a>         }
+<a name="163" href="#163">163</a>         <em class="jxr_comment">/*</em>
+<a name="164" href="#164">164</a> <em class="jxr_comment">         * If after all the parsing no Signature parts defined, set here a</em>
+<a name="165" href="#165">165</a> <em class="jxr_comment">         * default set. This is necessary because we add SignatureConfirmation</em>
+<a name="166" href="#166">166</a> <em class="jxr_comment">         * and therefore the default (Body) must be set here. The default setting</em>
+<a name="167" href="#167">167</a> <em class="jxr_comment">         * in WSSignEnvelope doesn't work because the vector is not empty anymore.</em>
+<a name="168" href="#168">168</a> <em class="jxr_comment">         */</em>
+<a name="169" href="#169">169</a>         <strong class="jxr_keyword">if</strong> (reqData.getSignatureParts().isEmpty()) {
+<a name="170" href="#170">170</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="171" href="#171">171</a>                     .getBodyQName().getLocalPart(), reqData.getSoapConstants()
+<a name="172" href="#172">172</a>                     .getEnvelopeURI(), <span class="jxr_string">"Content"</span>);
+<a name="173" href="#173">173</a>             reqData.getSignatureParts().add(encP);
+<a name="174" href="#174">174</a>         }
+<a name="175" href="#175">175</a>         <em class="jxr_comment">/*</em>
+<a name="176" href="#176">176</a> <em class="jxr_comment">         * If SignatureConfirmation is enabled and this is a response then</em>
+<a name="177" href="#177">177</a> <em class="jxr_comment">         * insert SignatureConfirmation elements, note their wsu:id in the signature</em>
+<a name="178" href="#178">178</a> <em class="jxr_comment">         * parts. They will be signed automatically during a (probably) defined</em>
+<a name="179" href="#179">179</a> <em class="jxr_comment">         * SIGN action.</em>
+<a name="180" href="#180">180</a> <em class="jxr_comment">         */</em>
+<a name="181" href="#181">181</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() &amp;&amp; !isRequest) {
+<a name="182" href="#182">182</a>             String done = 
+<a name="183" href="#183">183</a>                 (String)getProperty(reqData.getMsgContext(), WSHandlerConstants.SIG_CONF_DONE);
+<a name="184" href="#184">184</a>             <strong class="jxr_keyword">if</strong> (done == <strong class="jxr_keyword">null</strong>) {
+<a name="185" href="#185">185</a>                 wssConfig.getAction(WSConstants.SC).execute(<strong class="jxr_keyword">this</strong>, WSConstants.SC, doc, reqData);
+<a name="186" href="#186">186</a>             }
+<a name="187" href="#187">187</a>         }
+<a name="188" href="#188">188</a>         <em class="jxr_comment">/*</em>
+<a name="189" href="#189">189</a> <em class="jxr_comment">         * Here we have all necessary information to perform the requested</em>
+<a name="190" href="#190">190</a> <em class="jxr_comment">         * action(s).</em>
+<a name="191" href="#191">191</a> <em class="jxr_comment">         */</em>
+<a name="192" href="#192">192</a>         <strong class="jxr_keyword">for</strong> (Integer actionToDo : actions) {
+<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>                 <em class="jxr_comment">//</em>
+<a name="208" href="#208">208</a>                 <em class="jxr_comment">// Handle any "custom" actions, similarly,</em>
+<a name="209" href="#209">209</a>                 <em class="jxr_comment">// but to preserve behavior from previous</em>
+<a name="210" href="#210">210</a>                 <em class="jxr_comment">// versions, consume (but log) action lookup failures.</em>
+<a name="211" href="#211">211</a>                 <em class="jxr_comment">//</em>
+<a name="212" href="#212">212</a>             <strong class="jxr_keyword">default</strong>:
+<a name="213" href="#213">213</a>                 <a href="../../../../../org/apache/ws/security/action/Action.html">Action</a> doit = <strong class="jxr_keyword">null</strong>;
+<a name="214" href="#214">214</a>             <strong class="jxr_keyword">try</strong> {
+<a name="215" href="#215">215</a>                 doit = wssConfig.getAction(actionToDo);
+<a name="216" href="#216">216</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> WSSecurityException e) {
+<a name="217" href="#217">217</a>                 log.warn(
+<a name="218" href="#218">218</a>                         <span class="jxr_string">"Error trying to locate a custom action ("</span> + actionToDo + <span class="jxr_string">")"</span>, 
+<a name="219" href="#219">219</a>                         e
+<a name="220" href="#220">220</a>                 );
 <a name="221" href="#221">221</a>             }
-<a name="222" href="#222">222</a>             }
-<a name="223" href="#223">223</a>         }
-<a name="224" href="#224">224</a>         
-<a name="225" href="#225">225</a>         <em class="jxr_comment">/*</em>
-<a name="226" href="#226">226</a> <em class="jxr_comment">         * If this is a request then store all signature values. Add ours to</em>
-<a name="227" href="#227">227</a> <em class="jxr_comment">         * already gathered values because of chained handlers, e.g. for</em>
-<a name="228" href="#228">228</a> <em class="jxr_comment">         * other actors.</em>
-<a name="229" href="#229">229</a> <em class="jxr_comment">         */</em>
-<a name="230" href="#230">230</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() 
-<a name="231" href="#231">231</a>             &amp;&amp; isRequest &amp;&amp; reqData.getSignatureValues().size() &gt; 0) {
-<a name="232" href="#232">232</a>             List&lt;byte[]&gt; savedSignatures = 
-<a name="233" href="#233">233</a>                 (List&lt;byte[]&gt;)getProperty(reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV);
-<a name="234" href="#234">234</a>             <strong class="jxr_keyword">if</strong> (savedSignatures == <strong class="jxr_keyword">null</strong>) {
-<a name="235" href="#235">235</a>                 savedSignatures = <strong class="jxr_keyword">new</strong> ArrayList&lt;byte[]&gt;();
-<a name="236" href="#236">236</a>                 setProperty(
-<a name="237" href="#237">237</a>                     reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV, savedSignatures
-<a name="238" href="#238">238</a>                 );
-<a name="239" href="#239">239</a>             }
-<a name="240" href="#240">240</a>             savedSignatures.addAll(reqData.getSignatureValues());
-<a name="241" href="#241">241</a>         }
-<a name="242" href="#242">242</a>     }
-<a name="243" href="#243">243</a> 
-<a name="244" href="#244">244</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="245" href="#245">245</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="222" href="#222">222</a>             <strong class="jxr_keyword">if</strong> (doit != <strong class="jxr_keyword">null</strong>) {
+<a name="223" href="#223">223</a>                 doit.execute(<strong class="jxr_keyword">this</strong>, actionToDo, doc, reqData);
+<a name="224" href="#224">224</a>             }
+<a name="225" href="#225">225</a>             }
+<a name="226" href="#226">226</a>         }
+<a name="227" href="#227">227</a>         
+<a name="228" href="#228">228</a>         <em class="jxr_comment">/*</em>
+<a name="229" href="#229">229</a> <em class="jxr_comment">         * If this is a request then store all signature values. Add ours to</em>
+<a name="230" href="#230">230</a> <em class="jxr_comment">         * already gathered values because of chained handlers, e.g. for</em>
+<a name="231" href="#231">231</a> <em class="jxr_comment">         * other actors.</em>
+<a name="232" href="#232">232</a> <em class="jxr_comment">         */</em>
+<a name="233" href="#233">233</a>         <strong class="jxr_keyword">if</strong> (wssConfig.isEnableSignatureConfirmation() 
+<a name="234" href="#234">234</a>             &amp;&amp; isRequest &amp;&amp; reqData.getSignatureValues().size() &gt; 0) {
+<a name="235" href="#235">235</a>             List&lt;byte[]&gt; savedSignatures = 
+<a name="236" href="#236">236</a>                 (List&lt;byte[]&gt;)getProperty(reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV);
+<a name="237" href="#237">237</a>             <strong class="jxr_keyword">if</strong> (savedSignatures == <strong class="jxr_keyword">null</strong>) {
+<a name="238" href="#238">238</a>                 savedSignatures = <strong class="jxr_keyword">new</strong> ArrayList&lt;byte[]&gt;();
+<a name="239" href="#239">239</a>                 setProperty(
+<a name="240" href="#240">240</a>                     reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV, savedSignatures
+<a name="241" href="#241">241</a>                 );
+<a name="242" href="#242">242</a>             }
+<a name="243" href="#243">243</a>             savedSignatures.addAll(reqData.getSignatureValues());
+<a name="244" href="#244">244</a>         }
+<a name="245" href="#245">245</a>     }
 <a name="246" href="#246">246</a> 
-<a name="247" href="#247">247</a>         <a href="../../../../../org/apache/ws/security/WSSConfig.html">WSSConfig</a> wssConfig = reqData.getWssConfig();
-<a name="248" href="#248">248</a>         <strong class="jxr_keyword">if</strong> (wssConfig == <strong class="jxr_keyword">null</strong>) {
-<a name="249" href="#249">249</a>             wssConfig = secEngine.getWssConfig();
-<a name="250" href="#250">250</a>         }
-<a name="251" href="#251">251</a>         <strong class="jxr_keyword">boolean</strong> enableSigConf = decodeEnableSignatureConfirmation(reqData);
-<a name="252" href="#252">252</a>         wssConfig.setEnableSignatureConfirmation(
-<a name="253" href="#253">253</a>             enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
-<a name="254" href="#254">254</a>         );
-<a name="255" href="#255">255</a>         wssConfig.setTimeStampStrict(decodeTimestampStrict(reqData));
-<a name="256" href="#256">256</a>         <strong class="jxr_keyword">if</strong> (decodePasswordTypeStrict(reqData)) {
-<a name="257" href="#257">257</a>             String passwordType = decodePasswordType(reqData);
-<a name="258" href="#258">258</a>             wssConfig.setRequiredPasswordType(passwordType);
-<a name="259" href="#259">259</a>         }
-<a name="260" href="#260">260</a>         wssConfig.setTimeStampTTL(decodeTimeToLive(reqData));
-<a name="261" href="#261">261</a>         wssConfig.setTimeStampFutureTTL(decodeFutureTimeToLive(reqData));
-<a name="262" href="#262">262</a>         wssConfig.setHandleCustomPasswordTypes(decodeCustomPasswordTypes(reqData));
-<a name="263" href="#263">263</a>         wssConfig.setPasswordsAreEncoded(decodeUseEncodedPasswords(reqData));
-<a name="264" href="#264">264</a>         wssConfig.setAllowNamespaceQualifiedPasswordTypes(
-<a name="265" href="#265">265</a>             decodeNamespaceQualifiedPasswordTypes(reqData)
-<a name="266" href="#266">266</a>         );
-<a name="267" href="#267">267</a>         wssConfig.setSecretKeyLength(reqData.getSecretKeyLength());
-<a name="268" href="#268">268</a>         wssConfig.setWsiBSPCompliant(decodeBSPCompliance(reqData));
-<a name="269" href="#269">269</a>         reqData.setWssConfig(wssConfig);
-<a name="270" href="#270">270</a> 
-<a name="271" href="#271">271</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.SIGN) == WSConstants.SIGN) {
-<a name="272" href="#272">272</a>             decodeSignatureParameter2(reqData);
-<a name="273" href="#273">273</a>         }
-<a name="274" href="#274">274</a>         
-<a name="275" href="#275">275</a>         <strong class="jxr_keyword">if</strong> (((doAction &amp; WSConstants.ST_SIGNED) == WSConstants.ST_SIGNED)
-<a name="276" href="#276">276</a>             || ((doAction &amp; WSConstants.ST_UNSIGNED) == WSConstants.ST_UNSIGNED)) {
-<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>         decodeRequireSignedEncryptedDataElements(reqData);
-<a name="284" href="#284">284</a>     }
-<a name="285" href="#285">285</a> 
-<a name="286" href="#286">286</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResults(
-<a name="287" href="#287">287</a>         List&lt;WSSecurityEngineResult&gt; wsResult, List&lt;Integer&gt; actions
-<a name="288" href="#288">288</a>     ) {
-<a name="289" href="#289">289</a>         <strong class="jxr_keyword">int</strong> size = actions.size();
-<a name="290" href="#290">290</a>         <strong class="jxr_keyword">int</strong> ai = 0;
-<a name="291" href="#291">291</a>         <strong class="jxr_keyword">for</strong> (WSSecurityEngineResult result : wsResult) {
-<a name="292" href="#292">292</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
-<a name="293" href="#293">293</a>             <strong class="jxr_keyword">int</strong> act = actInt.intValue();
-<a name="294" href="#294">294</a>             <strong class="jxr_keyword">if</strong> (act == WSConstants.SC || act == WSConstants.BST) {
-<a name="295" href="#295">295</a>                 <strong class="jxr_keyword">continue</strong>;
-<a name="296" href="#296">296</a>             }
-<a name="297" href="#297">297</a>             
-<a name="298" href="#298">298</a>             <strong class="jxr_keyword">if</strong> (ai &gt;= size || actions.get(ai++).intValue() != act) {
-<a name="299" href="#299">299</a>                 <strong class="jxr_keyword">return</strong> false;
-<a name="300" href="#300">300</a>             }
-<a name="301" href="#301">301</a>         }
-<a name="302" href="#302">302</a> 
-<a name="303" href="#303">303</a>         <strong class="jxr_keyword">if</strong> (ai != size) {
-<a name="304" href="#304">304</a>             <strong class="jxr_keyword">return</strong> false;
-<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">return</strong> <strong class="jxr_keyword">true</strong>;
-<a name="308" href="#308">308</a>     }
-<a name="309" href="#309">309</a>     
-<a name="310" href="#310">310</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResultsAnyOrder(
-<a name="311" href="#311">311</a>         List&lt;WSSecurityEngineResult&gt; wsResult, List&lt;Integer&gt; actions
-<a name="312" href="#312">312</a>     ) {
-<a name="313" href="#313">313</a>         List&lt;Integer&gt; recordedActions = <strong class="jxr_keyword">new</strong> ArrayList&lt;Integer&gt;(actions.size());
-<a name="314" href="#314">314</a>         <strong class="jxr_keyword">for</strong> (Integer action : actions) {
-<a name="315" href="#315">315</a>             recordedActions.add(action);
-<a name="316" href="#316">316</a>         }
-<a name="317" href="#317">317</a>         
-<a name="318" href="#318">318</a>         <strong class="jxr_keyword">for</strong> (WSSecurityEngineResult result : wsResult) {
-<a name="319" href="#319">319</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
-<a name="320" href="#320">320</a>             <strong class="jxr_keyword">int</strong> act = actInt.intValue();
-<a name="321" href="#321">321</a>             <strong class="jxr_keyword">if</strong> (act == WSConstants.SC || act == WSConstants.BST) {
-<a name="322" href="#322">322</a>                 <strong class="jxr_keyword">continue</strong>;
-<a name="323" href="#323">323</a>             }
-<a name="324" href="#324">324</a>             
-<a name="325" href="#325">325</a>             <strong class="jxr_keyword">if</strong> (!recordedActions.remove(actInt)) {
-<a name="326" href="#326">326</a>                 <strong class="jxr_keyword">return</strong> false;
-<a name="327" href="#327">327</a>             }
-<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.isEmpty()) {
-<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>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a name="335" href="#335">335</a>     }
+<a name="247" href="#247">247</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="248" href="#248">248</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="249" href="#249">249</a> 
+<a name="250" href="#250">250</a>         <a href="../../../../../org/apache/ws/security/WSSConfig.html">WSSConfig</a> wssConfig = reqData.getWssConfig();
+<a name="251" href="#251">251</a>         <strong class="jxr_keyword">if</strong> (wssConfig == <strong class="jxr_keyword">null</strong>) {
+<a name="252" href="#252">252</a>             wssConfig = secEngine.getWssConfig();
+<a name="253" href="#253">253</a>         }
+<a name="254" href="#254">254</a>         <strong class="jxr_keyword">boolean</strong> enableSigConf = decodeEnableSignatureConfirmation(reqData);
+<a name="255" href="#255">255</a>         wssConfig.setEnableSignatureConfirmation(
+<a name="256" href="#256">256</a>             enableSigConf || ((doAction &amp; WSConstants.SC) != 0)
+<a name="257" href="#257">257</a>         );
+<a name="258" href="#258">258</a>         wssConfig.setTimeStampStrict(decodeTimestampStrict(reqData));
+<a name="259" href="#259">259</a>         <strong class="jxr_keyword">if</strong> (decodePasswordTypeStrict(reqData)) {
+<a name="260" href="#260">260</a>             String passwordType = decodePasswordType(reqData);
+<a name="261" href="#261">261</a>             wssConfig.setRequiredPasswordType(passwordType);
+<a name="262" href="#262">262</a>         }
+<a name="263" href="#263">263</a>         wssConfig.setTimeStampTTL(decodeTimeToLive(reqData));
+<a name="264" href="#264">264</a>         wssConfig.setTimeStampFutureTTL(decodeFutureTimeToLive(reqData));
+<a name="265" href="#265">265</a>         wssConfig.setHandleCustomPasswordTypes(decodeCustomPasswordTypes(reqData));
+<a name="266" href="#266">266</a>         wssConfig.setPasswordsAreEncoded(decodeUseEncodedPasswords(reqData));
+<a name="267" href="#267">267</a>         wssConfig.setAllowNamespaceQualifiedPasswordTypes(
+<a name="268" href="#268">268</a>             decodeNamespaceQualifiedPasswordTypes(reqData)
+<a name="269" href="#269">269</a>         );
+<a name="270" href="#270">270</a>         wssConfig.setSecretKeyLength(reqData.getSecretKeyLength());
+<a name="271" href="#271">271</a>         wssConfig.setWsiBSPCompliant(decodeBSPCompliance(reqData));
+<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>             || ((doAction &amp; WSConstants.ST_UNSIGNED) == WSConstants.ST_UNSIGNED)) {
+<a name="280" href="#280">280</a>             decodeSignatureParameter2(reqData);
+<a name="281" href="#281">281</a>         }
+<a name="282" href="#282">282</a>         
+<a name="283" href="#283">283</a>         <strong class="jxr_keyword">if</strong> ((doAction &amp; WSConstants.ENCR) == WSConstants.ENCR) {
+<a name="284" href="#284">284</a>             decodeDecryptionParameter(reqData);
+<a name="285" href="#285">285</a>         }
+<a name="286" href="#286">286</a>         decodeRequireSignedEncryptedDataElements(reqData);
+<a name="287" href="#287">287</a>     }
+<a name="288" href="#288">288</a> 
+<a name="289" href="#289">289</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResults(
+<a name="290" href="#290">290</a>         List&lt;WSSecurityEngineResult&gt; wsResult, List&lt;Integer&gt; actions
+<a name="291" href="#291">291</a>     ) {
+<a name="292" href="#292">292</a>         <strong class="jxr_keyword">int</strong> size = actions.size();
+<a name="293" href="#293">293</a>         <strong class="jxr_keyword">int</strong> ai = 0;
+<a name="294" href="#294">294</a>         <strong class="jxr_keyword">for</strong> (WSSecurityEngineResult result : wsResult) {
+<a name="295" href="#295">295</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) result.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>             
+<a name="301" href="#301">301</a>             <strong class="jxr_keyword">if</strong> (ai &gt;= size || actions.get(ai++).intValue() != act) {
+<a name="302" href="#302">302</a>                 <strong class="jxr_keyword">return</strong> false;
+<a name="303" href="#303">303</a>             }
+<a name="304" href="#304">304</a>         }
+<a name="305" href="#305">305</a> 
+<a name="306" href="#306">306</a>         <strong class="jxr_keyword">if</strong> (ai != size) {
+<a name="307" href="#307">307</a>             <strong class="jxr_keyword">return</strong> false;
+<a name="308" href="#308">308</a>         }
+<a name="309" href="#309">309</a> 
+<a name="310" href="#310">310</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a name="311" href="#311">311</a>     }
+<a name="312" href="#312">312</a>     
+<a name="313" href="#313">313</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> checkReceiverResultsAnyOrder(
+<a name="314" href="#314">314</a>         List&lt;WSSecurityEngineResult&gt; wsResult, List&lt;Integer&gt; actions
+<a name="315" href="#315">315</a>     ) {
+<a name="316" href="#316">316</a>         List&lt;Integer&gt; recordedActions = <strong class="jxr_keyword">new</strong> ArrayList&lt;Integer&gt;(actions.size());
+<a name="317" href="#317">317</a>         <strong class="jxr_keyword">for</strong> (Integer action : actions) {
+<a name="318" href="#318">318</a>             recordedActions.add(action);
+<a name="319" href="#319">319</a>         }
+<a name="320" href="#320">320</a>         
+<a name="321" href="#321">321</a>         <strong class="jxr_keyword">for</strong> (WSSecurityEngineResult result : wsResult) {
+<a name="322" href="#322">322</a>             <strong class="jxr_keyword">final</strong> Integer actInt = (Integer) result.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>     @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
-<a name="338" href="#338">338</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> checkSignatureConfirmation(
-<a name="339" href="#339">339</a>         <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData,
-<a name="340" href="#340">340</a>         List&lt;WSSecurityEngineResult&gt; resultList
-<a name="341" href="#341">341</a>     ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>{
-<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>         <em class="jxr_comment">//</em>
-<a name="346" href="#346">346</a>         <em class="jxr_comment">// First get all Signature values stored during sending the request</em>
-<a name="347" href="#347">347</a>         <em class="jxr_comment">//</em>
-<a name="348" href="#348">348</a>         List&lt;byte[]&gt; savedSignatures = 
-<a name="349" href="#349">349</a>             (List&lt;byte[]&gt;) getProperty(reqData.getMsgContext(), WSHandlerConstants.SEND_SIGV);
+<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>     @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
+<a name="341" href="#341">341</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> checkSignatureConfirmation(
+<a name="342" href="#342">342</a>         <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData,
+<a name="343" href="#343">343</a>         List&lt;WSSecurityEngineResult&gt; resultList
+<a name="344" href="#344">344</a>     ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>{
+<a name="345" href="#345">345</a>         <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="346" href="#346">346</a>             log.debug(<span class="jxr_string">"Check Signature confirmation"</span>);
+<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>         <em class="jxr_comment">// Now get all results that hold a SignatureConfirmation element from</em>
-<a name="352" href="#352">352</a>         <em class="jxr_comment">// the current run of receiver (we can have more than one run: if we</em>
-<a name="353" href="#353">353</a>         <em class="jxr_comment">// have several security header blocks with different actors/roles)</em>
-<a name="354" href="#354">354</a>         <em class="jxr_comment">//</em>
-<a name="355" href="#355">355</a>         List&lt;WSSecurityEngineResult&gt; sigConf = <strong class="jxr_keyword">new</strong> ArrayList&lt;WSSecurityEngineResult&gt;();
-<a name="356" href="#356">356</a>         WSSecurityUtil.fetchAllActionResults(resultList, WSConstants.SC, sigConf);
+<a name="351" href="#351">351</a>         List&lt;byte[]&gt; savedSignatures = 
+<a name="352" href="#352">352</a>             (List&lt;byte[]&gt;) getProperty(reqData.getMsgContext(), 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>         <em class="jxr_comment">// now loop over all SignatureConfirmation results and check:</em>
-<a name="359" href="#359">359</a>         <em class="jxr_comment">// - if there is a signature value and no Signature value generated in request: error</em>
-<a name="360" href="#360">360</a>         <em class="jxr_comment">// - if there is a signature value and no matching Signature value found: error</em>
-<a name="361" href="#361">361</a>         <em class="jxr_comment">// </em>
-<a name="362" href="#362">362</a>         <em class="jxr_comment">//  If a matching value found: remove from vector of stored signature values</em>
-<a name="363" href="#363">363</a>         <em class="jxr_comment">//</em>
-<a name="364" href="#364">364</a>         <strong class="jxr_keyword">for</strong> (WSSecurityEngineResult result : sigConf) {
-<a name="365" href="#365">365</a>             <a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a> sc = 
-<a name="366" href="#366">366</a>                 (<a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a>)result.get(
-<a name="367" href="#367">367</a>                     WSSecurityEngineResult.TAG_SIGNATURE_CONFIRMATION
-<a name="368" href="#368">368</a>                 );
-<a name="369" href="#369">369</a> 
-<a name="370" href="#370">370</a>             byte[] sigVal = sc.getSignatureValue();
-<a name="371" href="#371">371</a>             <strong class="jxr_keyword">if</strong> (sigVal != <strong class="jxr_keyword">null</strong>) {
-<a name="372" href="#372">372</a>                 <strong class="jxr_keyword">if</strong> (savedSignatures == <strong class="jxr_keyword">null</strong> || savedSignatures.size() == 0) {
-<a name="373" href="#373">373</a>                     <em class="jxr_comment">//</em>
-<a name="374" href="#374">374</a>                     <em class="jxr_comment">// If there are no stored signature values, and we've received a </em>
-<a name="375" href="#375">375</a>                     <em class="jxr_comment">// SignatureConfirmation element then throw an Exception</em>
+<a name="358" href="#358">358</a>         List&lt;WSSecurityEngineResult&gt; sigConf = <strong class="jxr_keyword">new</strong> ArrayList&lt;WSSecurityEngineResult&gt;();
+<a name="359" href="#359">359</a>         WSSecurityUtil.fetchAllActionResults(resultList, 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> (WSSecurityEngineResult result : sigConf) {
+<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(
+<a name="370" href="#370">370</a>                     WSSecurityEngineResult.TAG_SIGNATURE_CONFIRMATION
+<a name="371" href="#371">371</a>                 );
+<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> (savedSignatures == <strong class="jxr_keyword">null</strong> || savedSignatures.size() == 0) {
 <a name="376" href="#376">376</a>                     <em class="jxr_comment">//</em>
-<a name="377" href="#377">377</a>                     <strong class="jxr_keyword">if</strong> (sigVal.length != 0) {
-<a name="378" href="#378">378</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="379" href="#379">379</a>                             <span class="jxr_string">"Received a SignatureConfirmation element, but there are no stored"</span>
-<a name="380" href="#380">380</a>                              + <span class="jxr_string">" signature values"</span>
-<a name="381" href="#381">381</a>                         );
-<a name="382" href="#382">382</a>                     }
-<a name="383" href="#383">383</a>                 } <strong class="jxr_keyword">else</strong> {
-<a name="384" href="#384">384</a>                     <strong class="jxr_keyword">boolean</strong> found = false;
-<a name="385" href="#385">385</a>                     <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> j = 0; j &lt; savedSignatures.size(); j++) {
-<a name="386" href="#386">386</a>                         byte[] storedValue = (byte[]) savedSignatures.get(j);
-<a name="387" href="#387">387</a>                         <strong class="jxr_keyword">if</strong> (Arrays.equals(sigVal, storedValue)) {
-<a name="388" href="#388">388</a>                             found = <strong class="jxr_keyword">true</strong>;
-<a name="389" href="#389">389</a>                             savedSignatures.remove(j);
-<a name="390" href="#390">390</a>                             <strong class="jxr_keyword">break</strong>;
-<a name="391" href="#391">391</a>                         }
-<a name="392" href="#392">392</a>                     }
-<a name="393" href="#393">393</a>                     <strong class="jxr_keyword">if</strong> (!found) {
-<a name="394" href="#394">394</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="395" href="#395">395</a>                             <span class="jxr_string">"Received a SignatureConfirmation element, but there are no matching"</span>
-<a name="396" href="#396">396</a>                             + <span class="jxr_string">" stored signature values"</span>
-<a name="397" href="#397">397</a>                         );
-<a name="398" href="#398">398</a>                     } 
-<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>         <em class="jxr_comment">//</em>
-<a name="404" href="#404">404</a>         <em class="jxr_comment">// This indicates this is the last handler: the list holding the</em>
-<a name="405" href="#405">405</a>         <em class="jxr_comment">// stored Signature values must be empty, otherwise we have an error</em>
+<a name="377" href="#377">377</a>                     <em class="jxr_comment">// If there are no stored signature values, and we've received a </em>
+<a name="378" href="#378">378</a>                     <em class="jxr_comment">// SignatureConfirmation element then throw an Exception</em>
+<a name="379" href="#379">379</a>                     <em class="jxr_comment">//</em>
+<a name="380" href="#380">380</a>                     <strong class="jxr_keyword">if</strong> (sigVal.length != 0) {
+<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">"Received a SignatureConfirmation element, but there are no stored"</span>
+<a name="383" href="#383">383</a>                              + <span class="jxr_string">" signature values"</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>                     <strong class="jxr_keyword">boolean</strong> found = false;
+<a name="388" href="#388">388</a>                     <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> j = 0; j &lt; savedSignatures.size(); j++) {
+<a name="389" href="#389">389</a>                         byte[] storedValue = (byte[]) savedSignatures.get(j);
+<a name="390" href="#390">390</a>                         <strong class="jxr_keyword">if</strong> (Arrays.equals(sigVal, storedValue)) {
+<a name="391" href="#391">391</a>                             found = <strong class="jxr_keyword">true</strong>;
+<a name="392" href="#392">392</a>                             savedSignatures.remove(j);
+<a name="393" href="#393">393</a>                             <strong class="jxr_keyword">break</strong>;
+<a name="394" href="#394">394</a>                         }
+<a name="395" href="#395">395</a>                     }
+<a name="396" href="#396">396</a>                     <strong class="jxr_keyword">if</strong> (!found) {
+<a name="397" href="#397">397</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="398" href="#398">398</a>                             <span class="jxr_string">"Received a SignatureConfirmation element, but there are no matching"</span>
+<a name="399" href="#399">399</a>                             + <span class="jxr_string">" stored signature values"</span>
+<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> 
 <a name="406" href="#406">406</a>         <em class="jxr_comment">//</em>
-<a name="407" href="#407">407</a>         <strong class="jxr_keyword">if</strong> (!reqData.isNoSerialization()) {
-<a name="408" href="#408">408</a>             <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="409" href="#409">409</a>                 log.debug(<span class="jxr_string">"Check Signature confirmation - last handler"</span>);
-<a name="410" href="#410">410</a>             }
-<a name="411" href="#411">411</a>             <strong class="jxr_keyword">if</strong> (savedSignatures != <strong class="jxr_keyword">null</strong> &amp;&amp; !savedSignatures.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">"Check Signature confirmation: the stored signature values list is 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>     <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="420" href="#420">420</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="421" href="#421">421</a>         Object mc = reqData.getMsgContext();
-<a name="422" href="#422">422</a>         
-<a name="423" href="#423">423</a>         String type = getString(WSHandlerConstants.PASSWORD_TYPE, mc);
-<a name="424" href="#424">424</a>         <strong class="jxr_keyword">if</strong> (type != <strong class="jxr_keyword">null</strong>) {
-<a name="425" href="#425">425</a>             <strong class="jxr_keyword">if</strong> (WSConstants.PW_TEXT.equals(type)) {
-<a name="426" href="#426">426</a>                 reqData.setPwType(WSConstants.PASSWORD_TEXT);
-<a name="427" href="#427">427</a>             } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.PW_DIGEST.equals(type)) {
-<a name="428" href="#428">428</a>                 reqData.setPwType(WSConstants.PASSWORD_DIGEST);
-<a name="429" href="#429">429</a>             } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.PW_NONE.equals(type)) {
-<a name="430" href="#430">430</a>                 reqData.setPwType(<strong class="jxr_keyword">null</strong>);
-<a name="431" href="#431">431</a>             } <strong class="jxr_keyword">else</strong> {
-<a name="432" href="#432">432</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="433" href="#433">433</a>             }
-<a name="434" href="#434">434</a>         }
-<a name="435" href="#435">435</a>         
-<a name="436" href="#436">436</a>         String add = getString(WSHandlerConstants.ADD_UT_ELEMENTS, mc);
-<a name="437" href="#437">437</a>         <strong class="jxr_keyword">if</strong> (add != <strong class="jxr_keyword">null</strong>) {
-<a name="438" href="#438">438</a>             reqData.setUtElements(StringUtil.split(add, ' '));
-<a name="439" href="#439">439</a>         }
-<a name="440" href="#440">440</a>         
-<a name="441" href="#441">441</a>         String derived = getString(WSHandlerConstants.USE_DERIVED_KEY, mc);
-<a name="442" href="#442">442</a>         <strong class="jxr_keyword">if</strong> (derived != <strong class="jxr_keyword">null</strong>) {
-<a name="443" href="#443">443</a>             <strong class="jxr_keyword">boolean</strong> useDerivedKey = Boolean.parseBoolean(derived);
-<a name="444" href="#444">444</a>             reqData.setUseDerivedKey(useDerivedKey);
-<a name="445" href="#445">445</a>         }
-<a name="446" href="#446">446</a>         
-<a name="447" href="#447">447</a>         String derivedMAC = getString(WSHandlerConstants.USE_DERIVED_KEY_FOR_MAC, mc);
-<a name="448" href="#448">448</a>         <strong class="jxr_keyword">boolean</strong> useDerivedKeyForMAC = Boolean.parseBoolean(derivedMAC);
-<a name="449" href="#449">449</a>         <strong class="jxr_keyword">if</strong> (useDerivedKeyForMAC) {
-<a name="450" href="#450">450</a>             reqData.setUseDerivedKeyForMAC(useDerivedKeyForMAC);
-<a name="451" href="#451">451</a>         }
-<a name="452" href="#452">452</a>         
-<a name="453" href="#453">453</a>         String iterations = getString(WSHandlerConstants.DERIVED_KEY_ITERATIONS, mc);
-<a name="454" href="#454">454</a>         <strong class="jxr_keyword">if</strong> (iterations != <strong class="jxr_keyword">null</strong>) {
-<a name="455" href="#455">455</a>             <strong class="jxr_keyword">int</strong> iIterations = Integer.parseInt(iterations);
-<a name="456" href="#456">456</a>             reqData.setDerivedKeyIterations(iIterations);
-<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>     <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="461" href="#461">461</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="462" href="#462">462</a>         Object mc = reqData.getMsgContext();
-<a name="463" href="#463">463</a>         String signatureUser = getString(WSHandlerConstants.SIGNATURE_USER, mc);
-<a name="464" href="#464">464</a> 
-<a name="465" href="#465">465</a>         <strong class="jxr_keyword">if</strong> (signatureUser != <strong class="jxr_keyword">null</strong>) {
-<a name="466" href="#466">466</a>             reqData.setSignatureUser(signatureUser);
-<a name="467" href="#467">467</a>         } <strong class="jxr_keyword">else</strong> {
-<a name="468" href="#468">468</a>             reqData.setSignatureUser(reqData.getUsername());
-<a name="469" href="#469">469</a>         }
-<a name="470" href="#470">470</a>         
-<a name="471" href="#471">471</a>         String keyId = getString(WSHandlerConstants.SIG_KEY_ID, mc);
-<a name="472" href="#472">472</a>         <strong class="jxr_keyword">if</strong> (keyId != <strong class="jxr_keyword">null</strong>) {
-<a name="473" href="#473">473</a>             Integer id = (Integer) WSHandlerConstants.getKeyIdentifier(keyId);
-<a name="474" href="#474">474</a>             <strong class="jxr_keyword">if</strong> (id == <strong class="jxr_keyword">null</strong>) {
-<a name="475" href="#475">475</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="476" href="#476">476</a>                     <span class="jxr_string">"WSHandler: Signature: unknown key identification"</span>
-<a name="477" href="#477">477</a>                 );
-<a name="478" href="#478">478</a>             }
-<a name="479" href="#479">479</a>             <strong class="jxr_keyword">int</strong> tmp = id.intValue();
-<a name="480" href="#480">480</a>             <strong class="jxr_keyword">if</strong> (!(tmp == WSConstants.ISSUER_SERIAL
-<a name="481" href="#481">481</a>                     || tmp == WSConstants.BST_DIRECT_REFERENCE
-<a name="482" href="#482">482</a>                     || tmp == WSConstants.X509_KEY_IDENTIFIER
-<a name="483" href="#483">483</a>                     || tmp == WSConstants.SKI_KEY_IDENTIFIER
-<a name="484" href="#484">484</a>                     || tmp == WSConstants.THUMBPRINT_IDENTIFIER
-<a name="485" href="#485">485</a>                     || tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER)) {
-<a name="486" href="#486">486</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="487" href="#487">487</a>                     <span class="jxr_string">"WSHandler: Signature: illegal key identification"</span>
-<a name="488" href="#488">488</a>                 );
-<a name="489" href="#489">489</a>             }
-<a name="490" href="#490">490</a>             reqData.setSigKeyId(tmp);
-<a name="491" href="#491">491</a>         }
-<a name="492" href="#492">492</a>         String algo = getString(WSHandlerConstants.SIG_ALGO, mc);
-<a name="493" href="#493">493</a>         reqData.setSigAlgorithm(algo);
-<a name="494" href="#494">494</a>         
-<a name="495" href="#495">495</a>         String digestAlgo = getString(WSHandlerConstants.SIG_DIGEST_ALGO, mc);
-<a name="496" href="#496">496</a>         reqData.setSigDigestAlgorithm(digestAlgo);
-<a name="497" href="#497">497</a> 
-<a name="498" href="#498">498</a>         String parts = getString(WSHandlerConstants.SIGNATURE_PARTS, mc);
-<a name="499" href="#499">499</a>         <strong class="jxr_keyword">if</strong> (parts != <strong class="jxr_keyword">null</strong>) {
-<a name="500" href="#500">500</a>             splitEncParts(parts, reqData.getSignatureParts(), reqData);
-<a name="501" href="#501">501</a>         }
-<a name="502" href="#502">502</a>         
-<a name="503" href="#503">503</a>         String secretKeyLength = getString(WSHandlerConstants.WSE_SECRET_KEY_LENGTH, mc);
-<a name="504" href="#504">504</a>         <strong class="jxr_keyword">if</strong> (secretKeyLength != <strong class="jxr_keyword">null</strong>) {
-<a name="505" href="#505">505</a>             <strong class="jxr_keyword">int</strong> iSecretKeyLength = Integer.parseInt(secretKeyLength);
-<a name="506" href="#506">506</a>             reqData.setSecretKeyLength(iSecretKeyLength);
-<a name="507" href="#507">507</a>         }
-<a name="508" href="#508">508</a>         
-<a name="509" href="#509">509</a>         <strong class="jxr_keyword">boolean</strong> useSingleCert = decodeUseSingleCertificate(reqData);
-<a name="510" href="#510">510</a>         reqData.setUseSingleCert(useSingleCert);
-<a name="511" href="#511">511</a>     }
-<a name="512" href="#512">512</a> 
-<a name="513" href="#513">513</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> decodeEncryptionParameter(<a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> reqData) 
-<a name="514" href="#514">514</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="515" href="#515">515</a>         Object mc = reqData.getMsgContext();
-<a name="516" href="#516">516</a>         String encUser = getString(WSHandlerConstants.ENCRYPTION_USER, mc);
-<a name="517" href="#517">517</a> 
-<a name="518" href="#518">518</a>         <strong class="jxr_keyword">if</strong> (encUser != <strong class="jxr_keyword">null</strong>) {
-<a name="519" href="#519">519</a>             reqData.setEncUser(encUser);
-<a name="520" href="#520">520</a>         } <strong class="jxr_keyword">else</strong> {
-<a name="521" href="#521">521</a>             reqData.setEncUser(reqData.getUsername());
-<a name="522" href="#522">522</a>         }
-<a name="523" href="#523">523</a>         <strong class="jxr_keyword">if</strong> (reqData.getEncUser() == <strong class="jxr_keyword">null</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">"WSHandler: Encryption: no username"</span>);
+<a name="407" href="#407">407</a>         <em class="jxr_comment">// This indicates this is the last handler: the list holding the</em>
+<a name="408" href="#408">408</a>         <em class="jxr_comment">// stored Signature values must be empty, otherwise we have an error</em>
+<a name="409" href="#409">409</a>         <em class="jxr_comment">//</em>
+<a name="410" href="#410">410</a>         <strong class="jxr_keyword">if</strong> (!reqData.isNoSerialization()) {
+<a name="411" href="#411">411</a>             <strong class="jxr_keyword">if</strong> (doDebug) {
+<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>             }
+<a name="414" href="#414">414</a>             <strong class="jxr_keyword">if</strong> (savedSignatures != <strong class="jxr_keyword">null</strong> &amp;&amp; !savedSignatures.isEmpty()) {
+<a name="415" href="#415">415</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="416" href="#416">416</a>                     <span class="jxr_string">"Check Signature confirmation: the stored signature values list is not empty"</span>
+<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>     
+<a name="422" href="#422">422</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="423" href="#423">423</a>         <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="424" href="#424">424</a>         Object mc = reqData.getMsgContext();
+<a name="425" href="#425">425</a>         
+<a name="426" href="#426">426</a>         String type = getString(WSHandlerConstants.PASSWORD_TYPE, mc);
+<a name="427" href="#427">427</a>         <strong class="jxr_keyword">if</strong> (type != <strong class="jxr_keyword">null</strong>) {
+<a name="428" href="#428">428</a>             <strong class="jxr_keyword">if</strong> (WSConstants.PW_TEXT.equals(type)) {
+<a name="429" href="#429">429</a>                 reqData.setPwType(WSConstants.PASSWORD_TEXT);
+<a name="430" href="#430">430</a>             } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.PW_DIGEST.equals(type)) {
+<a name="431" href="#431">431</a>                 reqData.setPwType(WSConstants.PASSWORD_DIGEST);
+<a name="432" href="#432">432</a>             } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.PW_NONE.equals(type)) {
+<a name="433" href="#433">433</a>                 reqData.setPwType(<strong class="jxr_keyword">null</strong>);
+<a name="434" href="#434">434</a>             } <strong class="jxr_keyword">else</strong> {
+<a name="435" href="#435">435</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="436" href="#436">436</a>             }
+<a name="437" href="#437">437</a>         }
+<a name="438" href="#438">438</a>         
+<a name="439" href="#439">439</a>         String add = getString(WSHandlerConstants.ADD_UT_ELEMENTS, mc);
+<a name="440" href="#440">440</a>         <strong class="jxr_keyword">if</strong> (add != <strong class="jxr_keyword">null</strong>) {
+<a name="441" href="#441">441</a>             reqData.setUtElements(StringUtil.split(add, ' '));

[... 1418 lines stripped ...]