You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by co...@apache.org on 2009/04/20 15:56:38 UTC
svn commit: r766696 [25/36] - 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-use...
Modified: webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecSignatureConfirmation.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecSignatureConfirmation.html?rev=766696&r1=766695&r2=766696&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecSignatureConfirmation.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecSignatureConfirmation.html Mon Apr 20 13:56:25 2009
@@ -75,71 +75,70 @@
<a name="65" href="#65">65</a> <em class="jxr_javadoccomment"> */</em>
<a name="66" href="#66">66</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prepare(Document doc) {
<a name="67" href="#67">67</a> sc = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/SignatureConfirmation.html">SignatureConfirmation</a>(doc, signatureValue);
-<a name="68" href="#68">68</a> String scId = <span class="jxr_string">"SigConf-"</span> + sc.hashCode();
-<a name="69" href="#69">69</a> sc.setID(scId);
-<a name="70" href="#70">70</a> }
-<a name="71" href="#71">71</a>
-<a name="72" href="#72">72</a> <em class="jxr_javadoccomment">/**</em>
-<a name="73" href="#73">73</a> <em class="jxr_javadoccomment"> * Prepends the SignatureConfirmation element to the elements already in the</em>
-<a name="74" href="#74">74</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="75" href="#75">75</a> <em class="jxr_javadoccomment"> * </em>
-<a name="76" href="#76">76</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
-<a name="77" href="#77">77</a> <em class="jxr_javadoccomment"> * This allows to insert the SignatureConfirmation element at any position in the</em>
-<a name="78" href="#78">78</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="79" href="#79">79</a> <em class="jxr_javadoccomment"> * </em>
-<a name="80" href="#80">80</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
-<a name="81" href="#81">81</a> <em class="jxr_javadoccomment"> */</em>
-<a name="82" href="#82">82</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prependToHeader(<a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
-<a name="83" href="#83">83</a> WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), sc.getElement());
-<a name="84" href="#84">84</a> }
-<a name="85" href="#85">85</a>
-<a name="86" href="#86">86</a> <em class="jxr_javadoccomment">/**</em>
-<a name="87" href="#87">87</a> <em class="jxr_javadoccomment"> * Adds a new <code>SignatureConfirmation</code> to a soap envelope.</em>
-<a name="88" href="#88">88</a> <em class="jxr_javadoccomment"> * </em>
-<a name="89" href="#89">89</a> <em class="jxr_javadoccomment"> * A complete <code>SignatureConfirmation</code> is constructed and added</em>
-<a name="90" href="#90">90</a> <em class="jxr_javadoccomment"> * to the <code>wsse:Security</code> header.</em>
-<a name="91" href="#91">91</a> <em class="jxr_javadoccomment"> * </em>
-<a name="92" href="#92">92</a> <em class="jxr_javadoccomment"> * @param doc The SOAP envelope as W3C document</em>
-<a name="93" href="#93">93</a> <em class="jxr_javadoccomment"> * @param sigVal the Signature value. This will be the content of the "Value" attribute.</em>
-<a name="94" href="#94">94</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
-<a name="95" href="#95">95</a> <em class="jxr_javadoccomment"> * @return Document with SignatureConfirmation added</em>
-<a name="96" href="#96">96</a> <em class="jxr_javadoccomment"> */</em>
-<a name="97" href="#97">97</a> <strong class="jxr_keyword">public</strong> Document build(Document doc, byte[] sigVal, <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
-<a name="98" href="#98">98</a> log.debug(<span class="jxr_string">"Begin add signature confirmation..."</span>);
-<a name="99" href="#99">99</a>
-<a name="100" href="#100">100</a> signatureValue = sigVal;
-<a name="101" href="#101">101</a> prepare(doc);
-<a name="102" href="#102">102</a> prependToHeader(secHeader);
-<a name="103" href="#103">103</a>
-<a name="104" href="#104">104</a> <strong class="jxr_keyword">return</strong> doc;
-<a name="105" href="#105">105</a> }
-<a name="106" href="#106">106</a>
-<a name="107" href="#107">107</a> <em class="jxr_javadoccomment">/**</em>
-<a name="108" href="#108">108</a> <em class="jxr_javadoccomment"> * Get the id generated during <code>prepare()</code>.</em>
-<a name="109" href="#109">109</a> <em class="jxr_javadoccomment"> * </em>
-<a name="110" href="#110">110</a> <em class="jxr_javadoccomment"> * Returns the the value of wsu:Id attribute of this SignatureConfirmation. </em>
-<a name="111" href="#111">111</a> <em class="jxr_javadoccomment"> * </em>
-<a name="112" href="#112">112</a> <em class="jxr_javadoccomment"> * @return Return the wsu:Id of this token or null if <code>prepareToken()</code></em>
-<a name="113" href="#113">113</a> <em class="jxr_javadoccomment"> * was not called before.</em>
-<a name="114" href="#114">114</a> <em class="jxr_javadoccomment"> */</em>
-<a name="115" href="#115">115</a> <strong class="jxr_keyword">public</strong> String getId() {
-<a name="116" href="#116">116</a> <strong class="jxr_keyword">if</strong> (sc == <strong class="jxr_keyword">null</strong>) {
-<a name="117" href="#117">117</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="118" href="#118">118</a> }
-<a name="119" href="#119">119</a> <strong class="jxr_keyword">return</strong> sc.getID();
-<a name="120" href="#120">120</a> }
-<a name="121" href="#121">121</a>
-<a name="122" href="#122">122</a> <em class="jxr_javadoccomment">/**</em>
-<a name="123" href="#123">123</a> <em class="jxr_javadoccomment"> * Get the SignatureConfirmation element generated during </em>
-<a name="124" href="#124">124</a> <em class="jxr_javadoccomment"> * <code>prepare()</code>.</em>
-<a name="125" href="#125">125</a> <em class="jxr_javadoccomment"> * </em>
-<a name="126" href="#126">126</a> <em class="jxr_javadoccomment"> * @return Return the SignatureConfirmation element or null if <code>prepare()</code></em>
-<a name="127" href="#127">127</a> <em class="jxr_javadoccomment"> * was not called before.</em>
-<a name="128" href="#128">128</a> <em class="jxr_javadoccomment"> */</em>
-<a name="129" href="#129">129</a> <strong class="jxr_keyword">public</strong> Element getSignatureConfirmationElement() {
-<a name="130" href="#130">130</a> <strong class="jxr_keyword">return</strong> (<strong class="jxr_keyword">this</strong>.sc != <strong class="jxr_keyword">null</strong>) ? <strong class="jxr_keyword">this</strong>.sc.getElement() : <strong class="jxr_keyword">null</strong>;
-<a name="131" href="#131">131</a> }
-<a name="132" href="#132">132</a> }
+<a name="68" href="#68">68</a> sc.setID(wssConfig.getIdAllocator().createId(<span class="jxr_string">"SigConf-"</span>, sc));
+<a name="69" href="#69">69</a> }
+<a name="70" href="#70">70</a>
+<a name="71" href="#71">71</a> <em class="jxr_javadoccomment">/**</em>
+<a name="72" href="#72">72</a> <em class="jxr_javadoccomment"> * Prepends the SignatureConfirmation element to the elements already in the</em>
+<a name="73" href="#73">73</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="74" href="#74">74</a> <em class="jxr_javadoccomment"> * </em>
+<a name="75" href="#75">75</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
+<a name="76" href="#76">76</a> <em class="jxr_javadoccomment"> * This allows to insert the SignatureConfirmation element at any position in the</em>
+<a name="77" href="#77">77</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="78" href="#78">78</a> <em class="jxr_javadoccomment"> * </em>
+<a name="79" href="#79">79</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
+<a name="80" href="#80">80</a> <em class="jxr_javadoccomment"> */</em>
+<a name="81" href="#81">81</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prependToHeader(<a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
+<a name="82" href="#82">82</a> WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), sc.getElement());
+<a name="83" href="#83">83</a> }
+<a name="84" href="#84">84</a>
+<a name="85" href="#85">85</a> <em class="jxr_javadoccomment">/**</em>
+<a name="86" href="#86">86</a> <em class="jxr_javadoccomment"> * Adds a new <code>SignatureConfirmation</code> to a soap envelope.</em>
+<a name="87" href="#87">87</a> <em class="jxr_javadoccomment"> * </em>
+<a name="88" href="#88">88</a> <em class="jxr_javadoccomment"> * A complete <code>SignatureConfirmation</code> is constructed and added</em>
+<a name="89" href="#89">89</a> <em class="jxr_javadoccomment"> * to the <code>wsse:Security</code> header.</em>
+<a name="90" href="#90">90</a> <em class="jxr_javadoccomment"> * </em>
+<a name="91" href="#91">91</a> <em class="jxr_javadoccomment"> * @param doc The SOAP envelope as W3C document</em>
+<a name="92" href="#92">92</a> <em class="jxr_javadoccomment"> * @param sigVal the Signature value. This will be the content of the "Value" attribute.</em>
+<a name="93" href="#93">93</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
+<a name="94" href="#94">94</a> <em class="jxr_javadoccomment"> * @return Document with SignatureConfirmation added</em>
+<a name="95" href="#95">95</a> <em class="jxr_javadoccomment"> */</em>
+<a name="96" href="#96">96</a> <strong class="jxr_keyword">public</strong> Document build(Document doc, byte[] sigVal, <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
+<a name="97" href="#97">97</a> log.debug(<span class="jxr_string">"Begin add signature confirmation..."</span>);
+<a name="98" href="#98">98</a>
+<a name="99" href="#99">99</a> signatureValue = sigVal;
+<a name="100" href="#100">100</a> prepare(doc);
+<a name="101" href="#101">101</a> prependToHeader(secHeader);
+<a name="102" href="#102">102</a>
+<a name="103" href="#103">103</a> <strong class="jxr_keyword">return</strong> doc;
+<a name="104" href="#104">104</a> }
+<a name="105" href="#105">105</a>
+<a name="106" href="#106">106</a> <em class="jxr_javadoccomment">/**</em>
+<a name="107" href="#107">107</a> <em class="jxr_javadoccomment"> * Get the id generated during <code>prepare()</code>.</em>
+<a name="108" href="#108">108</a> <em class="jxr_javadoccomment"> * </em>
+<a name="109" href="#109">109</a> <em class="jxr_javadoccomment"> * Returns the the value of wsu:Id attribute of this SignatureConfirmation. </em>
+<a name="110" href="#110">110</a> <em class="jxr_javadoccomment"> * </em>
+<a name="111" href="#111">111</a> <em class="jxr_javadoccomment"> * @return Return the wsu:Id of this token or null if <code>prepareToken()</code></em>
+<a name="112" href="#112">112</a> <em class="jxr_javadoccomment"> * was not called before.</em>
+<a name="113" href="#113">113</a> <em class="jxr_javadoccomment"> */</em>
+<a name="114" href="#114">114</a> <strong class="jxr_keyword">public</strong> String getId() {
+<a name="115" href="#115">115</a> <strong class="jxr_keyword">if</strong> (sc == <strong class="jxr_keyword">null</strong>) {
+<a name="116" href="#116">116</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="117" href="#117">117</a> }
+<a name="118" href="#118">118</a> <strong class="jxr_keyword">return</strong> sc.getID();
+<a name="119" href="#119">119</a> }
+<a name="120" href="#120">120</a>
+<a name="121" href="#121">121</a> <em class="jxr_javadoccomment">/**</em>
+<a name="122" href="#122">122</a> <em class="jxr_javadoccomment"> * Get the SignatureConfirmation element generated during </em>
+<a name="123" href="#123">123</a> <em class="jxr_javadoccomment"> * <code>prepare()</code>.</em>
+<a name="124" href="#124">124</a> <em class="jxr_javadoccomment"> * </em>
+<a name="125" href="#125">125</a> <em class="jxr_javadoccomment"> * @return Return the SignatureConfirmation element or null if <code>prepare()</code></em>
+<a name="126" href="#126">126</a> <em class="jxr_javadoccomment"> * was not called before.</em>
+<a name="127" href="#127">127</a> <em class="jxr_javadoccomment"> */</em>
+<a name="128" href="#128">128</a> <strong class="jxr_keyword">public</strong> Element getSignatureConfirmationElement() {
+<a name="129" href="#129">129</a> <strong class="jxr_keyword">return</strong> (<strong class="jxr_keyword">this</strong>.sc != <strong class="jxr_keyword">null</strong>) ? <strong class="jxr_keyword">this</strong>.sc.getElement() : <strong class="jxr_keyword">null</strong>;
+<a name="130" href="#130">130</a> }
+<a name="131" href="#131">131</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecTimestamp.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecTimestamp.html?rev=766696&r1=766695&r2=766696&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecTimestamp.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecTimestamp.html Mon Apr 20 13:56:25 2009
@@ -78,7 +78,7 @@
<a name="68" href="#68">68</a> <em class="jxr_javadoccomment"> */</em>
<a name="69" href="#69">69</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prepare(Document doc) {
<a name="70" href="#70">70</a> ts = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/Timestamp.html">Timestamp</a>(wssConfig.isPrecisionInMilliSeconds(), doc, timeToLive);
-<a name="71" href="#71">71</a> String tsId = <span class="jxr_string">"Timestamp-"</span> + ts.hashCode();
+<a name="71" href="#71">71</a> String tsId = wssConfig.getIdAllocator().createId(<span class="jxr_string">"Timestamp-"</span>, ts);
<a name="72" href="#72">72</a> ts.setID(tsId);
<a name="73" href="#73">73</a> }
<a name="74" href="#74">74</a>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecUsernameToken.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecUsernameToken.html?rev=766696&r1=766695&r2=766696&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecUsernameToken.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecUsernameToken.html Mon Apr 20 13:56:25 2009
@@ -45,222 +45,213 @@
<a name="35" href="#35">35</a> <em class="jxr_javadoccomment"> */</em>
<a name="36" href="#36">36</a>
<a name="37" href="#37">37</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/ws/security/message/WSSecUsernameToken.html">WSSecUsernameToken</a> <strong class="jxr_keyword">extends</strong> <a href="../../../../../org/apache/ws/security/message/WSSecBase.html">WSSecBase</a> {
-<a name="38" href="#38">38</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> Log log = LogFactory.getLog(WSSecUsernameToken.<strong class="jxr_keyword">class</strong>
-<a name="39" href="#39">39</a> .getName());
-<a name="40" href="#40">40</a>
-<a name="41" href="#41">41</a> <strong class="jxr_keyword">private</strong> String passwordType = WSConstants.PASSWORD_DIGEST;
-<a name="42" href="#42">42</a>
-<a name="43" href="#43">43</a> <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/ws/security/message/token/UsernameToken.html">UsernameToken</a> ut = <strong class="jxr_keyword">null</strong>;
-<a name="44" href="#44">44</a>
-<a name="45" href="#45">45</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> nonce = false;
-<a name="46" href="#46">46</a>
-<a name="47" href="#47">47</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> created = false;
-<a name="48" href="#48">48</a>
-<a name="49" href="#49">49</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> useDerivedKey = false;
-<a name="50" href="#50">50</a>
-<a name="51" href="#51">51</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> useMac = false;
-<a name="52" href="#52">52</a>
-<a name="53" href="#53">53</a> <strong class="jxr_keyword">private</strong> byte[] saltValue;
-<a name="54" href="#54">54</a>
-<a name="55" href="#55">55</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">int</strong> iteration = UsernameToken.DEFAULT_ITERATION;
-<a name="56" href="#56">56</a>
-<a name="57" href="#57">57</a> <em class="jxr_javadoccomment">/**</em>
-<a name="58" href="#58">58</a> <em class="jxr_javadoccomment"> * Constructor.</em>
-<a name="59" href="#59">59</a> <em class="jxr_javadoccomment"> */</em>
-<a name="60" href="#60">60</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/ws/security/message/WSSecUsernameToken.html">WSSecUsernameToken</a>() {
-<a name="61" href="#61">61</a> }
-<a name="62" href="#62">62</a>
-<a name="63" href="#63">63</a> <em class="jxr_javadoccomment">/**</em>
-<a name="64" href="#64">64</a> <em class="jxr_javadoccomment"> * Defines how to construct the password element of the</em>
-<a name="65" href="#65">65</a> <em class="jxr_javadoccomment"> * <code>UsernameToken</code>.</em>
-<a name="66" href="#66">66</a> <em class="jxr_javadoccomment"> * </em>
-<a name="67" href="#67">67</a> <em class="jxr_javadoccomment"> * @param pwType</em>
-<a name="68" href="#68">68</a> <em class="jxr_javadoccomment"> * contains the password type. Only allowed values are</em>
-<a name="69" href="#69">69</a> <em class="jxr_javadoccomment"> * {@link WSConstants#PASSWORD_DIGEST} and</em>
-<a name="70" href="#70">70</a> <em class="jxr_javadoccomment"> * {@link WSConstants#PASSWORD_TEXT}.</em>
-<a name="71" href="#71">71</a> <em class="jxr_javadoccomment"> * or null when no password is needed.</em>
-<a name="72" href="#72">72</a> <em class="jxr_javadoccomment"> */</em>
-<a name="73" href="#73">73</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> setPasswordType(String pwType) {
-<a name="74" href="#74">74</a> <strong class="jxr_keyword">this</strong>.passwordType = pwType;
-<a name="75" href="#75">75</a> }
-<a name="76" href="#76">76</a>
-<a name="77" href="#77">77</a> <em class="jxr_javadoccomment">/**</em>
-<a name="78" href="#78">78</a> <em class="jxr_javadoccomment"> * Add a Nonce element to the UsernameToken.</em>
-<a name="79" href="#79">79</a> <em class="jxr_javadoccomment"> */</em>
-<a name="80" href="#80">80</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addNonce() {
-<a name="81" href="#81">81</a> nonce = <strong class="jxr_keyword">true</strong>;
-<a name="82" href="#82">82</a> }
-<a name="83" href="#83">83</a>
-<a name="84" href="#84">84</a> <em class="jxr_javadoccomment">/**</em>
-<a name="85" href="#85">85</a> <em class="jxr_javadoccomment"> * Add a Created element to the UsernameToken.</em>
-<a name="86" href="#86">86</a> <em class="jxr_javadoccomment"> */</em>
-<a name="87" href="#87">87</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addCreated() {
-<a name="88" href="#88">88</a> created = <strong class="jxr_keyword">true</strong>;
-<a name="89" href="#89">89</a> }
-<a name="90" href="#90">90</a>
-<a name="91" href="#91">91</a> <em class="jxr_javadoccomment">/**</em>
-<a name="92" href="#92">92</a> <em class="jxr_javadoccomment"> * Add a derived key to the UsernameToken</em>
-<a name="93" href="#93">93</a> <em class="jxr_javadoccomment"> * @param useMac whether the derived key is to be used for a MAC or not</em>
-<a name="94" href="#94">94</a> <em class="jxr_javadoccomment"> * @param saltValue The salt value to use</em>
-<a name="95" href="#95">95</a> <em class="jxr_javadoccomment"> * @param iteration The number of iterations to use in deriving a key</em>
-<a name="96" href="#96">96</a> <em class="jxr_javadoccomment"> */</em>
-<a name="97" href="#97">97</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addDerivedKey(<strong class="jxr_keyword">boolean</strong> useMac, byte[] saltValue, <strong class="jxr_keyword">int</strong> iteration) {
-<a name="98" href="#98">98</a> passwordType = <strong class="jxr_keyword">null</strong>;
-<a name="99" href="#99">99</a> useDerivedKey = <strong class="jxr_keyword">true</strong>;
-<a name="100" href="#100">100</a> <strong class="jxr_keyword">this</strong>.useMac = useMac;
-<a name="101" href="#101">101</a> <strong class="jxr_keyword">this</strong>.saltValue = saltValue;
-<a name="102" href="#102">102</a> <strong class="jxr_keyword">if</strong> (iteration > 0) {
-<a name="103" href="#103">103</a> <strong class="jxr_keyword">this</strong>.iteration = iteration;
-<a name="104" href="#104">104</a> }
-<a name="105" href="#105">105</a> }
-<a name="106" href="#106">106</a>
-<a name="107" href="#107">107</a>
-<a name="108" href="#108">108</a> <em class="jxr_javadoccomment">/**</em>
-<a name="109" href="#109">109</a> <em class="jxr_javadoccomment"> * Get the derived secret key.</em>
-<a name="110" href="#110">110</a> <em class="jxr_javadoccomment"> * </em>
-<a name="111" href="#111">111</a> <em class="jxr_javadoccomment"> * After the <code>prepare()</code> method was called use this method</em>
-<a name="112" href="#112">112</a> <em class="jxr_javadoccomment"> * to compute a derived secret key. If "useDerivedKey" is set, then the returned secret</em>
-<a name="113" href="#113">113</a> <em class="jxr_javadoccomment"> * key is derived as per the UsernameToken 1.1 specification. Otherwise, the generation </em>
-<a name="114" href="#114">114</a> <em class="jxr_javadoccomment"> * of this secret key is according to the WS-Trust specifications.</em>
-<a name="115" href="#115">115</a> <em class="jxr_javadoccomment"> * </em>
-<a name="116" href="#116">116</a> <em class="jxr_javadoccomment"> * @return Return the derived secret key of this token or null if <code>prepare()</code></em>
-<a name="117" href="#117">117</a> <em class="jxr_javadoccomment"> * was not called before.</em>
-<a name="118" href="#118">118</a> <em class="jxr_javadoccomment"> */</em>
-<a name="119" href="#119">119</a> <strong class="jxr_keyword">public</strong> byte[] getSecretKey() <strong class="jxr_keyword">throws</strong> WSSecurityException {
-<a name="120" href="#120">120</a> <strong class="jxr_keyword">if</strong> (ut == <strong class="jxr_keyword">null</strong>) {
-<a name="121" href="#121">121</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="122" href="#122">122</a> }
-<a name="123" href="#123">123</a> <strong class="jxr_keyword">if</strong> (useDerivedKey) {
-<a name="124" href="#124">124</a> <strong class="jxr_keyword">return</strong> UsernameToken.generateDerivedKey(password, saltValue, iteration);
-<a name="125" href="#125">125</a> }
-<a name="126" href="#126">126</a> <strong class="jxr_keyword">return</strong> ut.getSecretKey();
-<a name="127" href="#127">127</a> }
-<a name="128" href="#128">128</a>
-<a name="129" href="#129">129</a> <em class="jxr_javadoccomment">/**</em>
-<a name="130" href="#130">130</a> <em class="jxr_javadoccomment"> * Get the derived key.</em>
-<a name="131" href="#131">131</a> <em class="jxr_javadoccomment"> * </em>
-<a name="132" href="#132">132</a> <em class="jxr_javadoccomment"> * After the <code>prepare()</code> method was called use this method</em>
-<a name="133" href="#133">133</a> <em class="jxr_javadoccomment"> * to compute a derived key. The generation of this secret key is according</em>
-<a name="134" href="#134">134</a> <em class="jxr_javadoccomment"> * to the UsernameTokenProfile 1.1 specification (section 4 - Key Derivation).</em>
-<a name="135" href="#135">135</a> <em class="jxr_javadoccomment"> * </em>
-<a name="136" href="#136">136</a> <em class="jxr_javadoccomment"> * @return Return the derived key of this token or null if <code>prepare()</code></em>
-<a name="137" href="#137">137</a> <em class="jxr_javadoccomment"> * was not called before.</em>
-<a name="138" href="#138">138</a> <em class="jxr_javadoccomment"> */</em>
-<a name="139" href="#139">139</a> <strong class="jxr_keyword">public</strong> byte[] getDerivedKey() <strong class="jxr_keyword">throws</strong> WSSecurityException {
-<a name="140" href="#140">140</a> <strong class="jxr_keyword">if</strong> (ut == <strong class="jxr_keyword">null</strong> || !useDerivedKey) {
-<a name="141" href="#141">141</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="142" href="#142">142</a> }
-<a name="143" href="#143">143</a> <strong class="jxr_keyword">return</strong> UsernameToken.generateDerivedKey(password, saltValue, iteration);
-<a name="144" href="#144">144</a> }
-<a name="145" href="#145">145</a>
-<a name="146" href="#146">146</a> <em class="jxr_javadoccomment">/**</em>
-<a name="147" href="#147">147</a> <em class="jxr_javadoccomment"> * Get the id generated during <code>prepare()</code>.</em>
-<a name="148" href="#148">148</a> <em class="jxr_javadoccomment"> * </em>
-<a name="149" href="#149">149</a> <em class="jxr_javadoccomment"> * Returns the the value of wsu:Id attribute of this UsernameToken. </em>
-<a name="150" href="#150">150</a> <em class="jxr_javadoccomment"> * </em>
-<a name="151" href="#151">151</a> <em class="jxr_javadoccomment"> * @return Return the wsu:Id of this token or null if <code>prepare()</code></em>
-<a name="152" href="#152">152</a> <em class="jxr_javadoccomment"> * was not called before.</em>
-<a name="153" href="#153">153</a> <em class="jxr_javadoccomment"> */</em>
-<a name="154" href="#154">154</a> <strong class="jxr_keyword">public</strong> String getId() {
-<a name="155" href="#155">155</a> <strong class="jxr_keyword">if</strong> (ut == <strong class="jxr_keyword">null</strong>) {
-<a name="156" href="#156">156</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="157" href="#157">157</a> }
-<a name="158" href="#158">158</a> <strong class="jxr_keyword">return</strong> ut.getID();
-<a name="159" href="#159">159</a> }
-<a name="160" href="#160">160</a>
-<a name="161" href="#161">161</a> <em class="jxr_javadoccomment">/**</em>
-<a name="162" href="#162">162</a> <em class="jxr_javadoccomment"> * Creates a Username token.</em>
-<a name="163" href="#163">163</a> <em class="jxr_javadoccomment"> * </em>
-<a name="164" href="#164">164</a> <em class="jxr_javadoccomment"> * The method prepares and initializes a WSSec UsernameToken structure after</em>
-<a name="165" href="#165">165</a> <em class="jxr_javadoccomment"> * the relevant information was set. A Before calling</em>
-<a name="166" href="#166">166</a> <em class="jxr_javadoccomment"> * <code>prepare()</code> all parameters such as user, password,</em>
-<a name="167" href="#167">167</a> <em class="jxr_javadoccomment"> * passwordType etc. must be set. A complete <code>UsernameToken</code> is</em>
-<a name="168" href="#168">168</a> <em class="jxr_javadoccomment"> * constructed.</em>
-<a name="169" href="#169">169</a> <em class="jxr_javadoccomment"> * </em>
-<a name="170" href="#170">170</a> <em class="jxr_javadoccomment"> * @param doc The SOAP envelope as W3C document</em>
-<a name="171" href="#171">171</a> <em class="jxr_javadoccomment"> */</em>
-<a name="172" href="#172">172</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prepare(Document doc) {
-<a name="173" href="#173">173</a> ut = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/UsernameToken.html">UsernameToken</a>(wssConfig.isPrecisionInMilliSeconds(), doc, passwordType);
-<a name="174" href="#174">174</a> ut.setName(user);
-<a name="175" href="#175">175</a> <strong class="jxr_keyword">if</strong> (useDerivedKey) {
-<a name="176" href="#176">176</a> saltValue = ut.addSalt(doc, saltValue, useMac);
-<a name="177" href="#177">177</a> ut.addIteration(doc, iteration);
-<a name="178" href="#178">178</a> } <strong class="jxr_keyword">else</strong> {
-<a name="179" href="#179">179</a> ut.setPassword(password);
-<a name="180" href="#180">180</a> }
-<a name="181" href="#181">181</a> <strong class="jxr_keyword">if</strong> (nonce) {
-<a name="182" href="#182">182</a> ut.addNonce(doc);
-<a name="183" href="#183">183</a> }
-<a name="184" href="#184">184</a> <strong class="jxr_keyword">if</strong> (created) {
-<a name="185" href="#185">185</a> ut.addCreated(wssConfig.isPrecisionInMilliSeconds(), doc);
-<a name="186" href="#186">186</a> }
-<a name="187" href="#187">187</a> String utId = <span class="jxr_string">"UsernameToken-"</span> + ut.hashCode();
-<a name="188" href="#188">188</a> ut.setID(utId);
-<a name="189" href="#189">189</a> }
-<a name="190" href="#190">190</a>
-<a name="191" href="#191">191</a> <em class="jxr_javadoccomment">/**</em>
-<a name="192" href="#192">192</a> <em class="jxr_javadoccomment"> * Prepends the UsernameToken element to the elements already in the</em>
-<a name="193" href="#193">193</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="194" href="#194">194</a> <em class="jxr_javadoccomment"> * </em>
-<a name="195" href="#195">195</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
-<a name="196" href="#196">196</a> <em class="jxr_javadoccomment"> * This allows to insert the UsernameToken element at any position in the</em>
-<a name="197" href="#197">197</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="198" href="#198">198</a> <em class="jxr_javadoccomment"> * </em>
-<a name="199" href="#199">199</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
-<a name="200" href="#200">200</a> <em class="jxr_javadoccomment"> */</em>
-<a name="201" href="#201">201</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prependToHeader(<a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
-<a name="202" href="#202">202</a> WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), ut.getElement());
-<a name="203" href="#203">203</a> }
-<a name="204" href="#204">204</a>
-<a name="205" href="#205">205</a> <em class="jxr_javadoccomment">/**</em>
-<a name="206" href="#206">206</a> <em class="jxr_javadoccomment"> * Appends the UsernameToken element to the elements already in the</em>
-<a name="207" href="#207">207</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="208" href="#208">208</a> <em class="jxr_javadoccomment"> * </em>
-<a name="209" href="#209">209</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
-<a name="210" href="#210">210</a> <em class="jxr_javadoccomment"> * This allows to insert the UsernameToken element at any position in the</em>
-<a name="211" href="#211">211</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="212" href="#212">212</a> <em class="jxr_javadoccomment"> * </em>
-<a name="213" href="#213">213</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
-<a name="214" href="#214">214</a> <em class="jxr_javadoccomment"> */</em>
-<a name="215" href="#215">215</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> appendToHeader(<a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
-<a name="216" href="#216">216</a> Element secHeaderElement = secHeader.getSecurityHeader();
-<a name="217" href="#217">217</a> secHeaderElement.appendChild(ut.getElement());
-<a name="218" href="#218">218</a> }
-<a name="219" href="#219">219</a>
-<a name="220" href="#220">220</a> <em class="jxr_javadoccomment">/**</em>
-<a name="221" href="#221">221</a> <em class="jxr_javadoccomment"> * Adds a new <code>UsernameToken</code> to a soap envelope.</em>
-<a name="222" href="#222">222</a> <em class="jxr_javadoccomment"> * </em>
-<a name="223" href="#223">223</a> <em class="jxr_javadoccomment"> * Before calling <code>build()</code> all parameters such as user,</em>
-<a name="224" href="#224">224</a> <em class="jxr_javadoccomment"> * password, passwordType etc. must be set. A complete</em>
-<a name="225" href="#225">225</a> <em class="jxr_javadoccomment"> * <code>UsernameToken</code> is constructed and added to the</em>
-<a name="226" href="#226">226</a> <em class="jxr_javadoccomment"> * <code>wsse:Security</code> header.</em>
-<a name="227" href="#227">227</a> <em class="jxr_javadoccomment"> * </em>
-<a name="228" href="#228">228</a> <em class="jxr_javadoccomment"> * @param doc The SOAP envelope as W3C document</em>
-<a name="229" href="#229">229</a> <em class="jxr_javadoccomment"> * @param secHeader The security header inside the SOAP envelope</em>
-<a name="230" href="#230">230</a> <em class="jxr_javadoccomment"> * @return Document with UsernameToken added</em>
-<a name="231" href="#231">231</a> <em class="jxr_javadoccomment"> */</em>
-<a name="232" href="#232">232</a> <strong class="jxr_keyword">public</strong> Document build(Document doc, <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
-<a name="233" href="#233">233</a> log.debug(<span class="jxr_string">"Begin add username token..."</span>);
-<a name="234" href="#234">234</a>
-<a name="235" href="#235">235</a> prepare(doc);
-<a name="236" href="#236">236</a> prependToHeader(secHeader);
-<a name="237" href="#237">237</a>
-<a name="238" href="#238">238</a> <strong class="jxr_keyword">return</strong> doc;
-<a name="239" href="#239">239</a> }
-<a name="240" href="#240">240</a>
-<a name="241" href="#241">241</a> <em class="jxr_javadoccomment">/**</em>
-<a name="242" href="#242">242</a> <em class="jxr_javadoccomment"> * Returns the <code>UsernameToken</code> element.</em>
-<a name="243" href="#243">243</a> <em class="jxr_javadoccomment"> * </em>
-<a name="244" href="#244">244</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
-<a name="245" href="#245">245</a> <em class="jxr_javadoccomment"> * This allows to insert the UsernameToken element at any position in the</em>
-<a name="246" href="#246">246</a> <em class="jxr_javadoccomment"> * Security header.</em>
-<a name="247" href="#247">247</a> <em class="jxr_javadoccomment"> * </em>
-<a name="248" href="#248">248</a> <em class="jxr_javadoccomment"> * @return the Username Token element</em>
-<a name="249" href="#249">249</a> <em class="jxr_javadoccomment"> */</em>
-<a name="250" href="#250">250</a> <strong class="jxr_keyword">public</strong> Element getUsernameTokenElement() {
-<a name="251" href="#251">251</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>.ut.getElement();
-<a name="252" href="#252">252</a> }
-<a name="253" href="#253">253</a> }
+<a name="38" href="#38">38</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> Log log = LogFactory.getLog(WSSecUsernameToken.<strong class="jxr_keyword">class</strong>.getName());
+<a name="39" href="#39">39</a>
+<a name="40" href="#40">40</a> <strong class="jxr_keyword">private</strong> String passwordType = WSConstants.PASSWORD_DIGEST;
+<a name="41" href="#41">41</a> <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/ws/security/message/token/UsernameToken.html">UsernameToken</a> ut = <strong class="jxr_keyword">null</strong>;
+<a name="42" href="#42">42</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> nonce = false;
+<a name="43" href="#43">43</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> created = false;
+<a name="44" href="#44">44</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> useDerivedKey = false;
+<a name="45" href="#45">45</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">boolean</strong> useMac = false;
+<a name="46" href="#46">46</a> <strong class="jxr_keyword">private</strong> byte[] saltValue;
+<a name="47" href="#47">47</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">int</strong> iteration = UsernameToken.DEFAULT_ITERATION;
+<a name="48" href="#48">48</a>
+<a name="49" href="#49">49</a> <em class="jxr_javadoccomment">/**</em>
+<a name="50" href="#50">50</a> <em class="jxr_javadoccomment"> * Constructor.</em>
+<a name="51" href="#51">51</a> <em class="jxr_javadoccomment"> */</em>
+<a name="52" href="#52">52</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/ws/security/message/WSSecUsernameToken.html">WSSecUsernameToken</a>() {
+<a name="53" href="#53">53</a> }
+<a name="54" href="#54">54</a>
+<a name="55" href="#55">55</a> <em class="jxr_javadoccomment">/**</em>
+<a name="56" href="#56">56</a> <em class="jxr_javadoccomment"> * Defines how to construct the password element of the</em>
+<a name="57" href="#57">57</a> <em class="jxr_javadoccomment"> * <code>UsernameToken</code>.</em>
+<a name="58" href="#58">58</a> <em class="jxr_javadoccomment"> * </em>
+<a name="59" href="#59">59</a> <em class="jxr_javadoccomment"> * @param pwType</em>
+<a name="60" href="#60">60</a> <em class="jxr_javadoccomment"> * contains the password type. Only allowed values are</em>
+<a name="61" href="#61">61</a> <em class="jxr_javadoccomment"> * {@link WSConstants#PASSWORD_DIGEST} and</em>
+<a name="62" href="#62">62</a> <em class="jxr_javadoccomment"> * {@link WSConstants#PASSWORD_TEXT}.</em>
+<a name="63" href="#63">63</a> <em class="jxr_javadoccomment"> * or null when no password is needed.</em>
+<a name="64" href="#64">64</a> <em class="jxr_javadoccomment"> */</em>
+<a name="65" href="#65">65</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> setPasswordType(String pwType) {
+<a name="66" href="#66">66</a> <strong class="jxr_keyword">this</strong>.passwordType = pwType;
+<a name="67" href="#67">67</a> }
+<a name="68" href="#68">68</a>
+<a name="69" href="#69">69</a> <em class="jxr_javadoccomment">/**</em>
+<a name="70" href="#70">70</a> <em class="jxr_javadoccomment"> * Add a Nonce element to the UsernameToken.</em>
+<a name="71" href="#71">71</a> <em class="jxr_javadoccomment"> */</em>
+<a name="72" href="#72">72</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addNonce() {
+<a name="73" href="#73">73</a> nonce = <strong class="jxr_keyword">true</strong>;
+<a name="74" href="#74">74</a> }
+<a name="75" href="#75">75</a>
+<a name="76" href="#76">76</a> <em class="jxr_javadoccomment">/**</em>
+<a name="77" href="#77">77</a> <em class="jxr_javadoccomment"> * Add a Created element to the UsernameToken.</em>
+<a name="78" href="#78">78</a> <em class="jxr_javadoccomment"> */</em>
+<a name="79" href="#79">79</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addCreated() {
+<a name="80" href="#80">80</a> created = <strong class="jxr_keyword">true</strong>;
+<a name="81" href="#81">81</a> }
+<a name="82" href="#82">82</a>
+<a name="83" href="#83">83</a> <em class="jxr_javadoccomment">/**</em>
+<a name="84" href="#84">84</a> <em class="jxr_javadoccomment"> * Add a derived key to the UsernameToken</em>
+<a name="85" href="#85">85</a> <em class="jxr_javadoccomment"> * @param useMac whether the derived key is to be used for a MAC or not</em>
+<a name="86" href="#86">86</a> <em class="jxr_javadoccomment"> * @param saltValue The salt value to use</em>
+<a name="87" href="#87">87</a> <em class="jxr_javadoccomment"> * @param iteration The number of iterations to use in deriving a key</em>
+<a name="88" href="#88">88</a> <em class="jxr_javadoccomment"> */</em>
+<a name="89" href="#89">89</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addDerivedKey(<strong class="jxr_keyword">boolean</strong> useMac, byte[] saltValue, <strong class="jxr_keyword">int</strong> iteration) {
+<a name="90" href="#90">90</a> passwordType = <strong class="jxr_keyword">null</strong>;
+<a name="91" href="#91">91</a> useDerivedKey = <strong class="jxr_keyword">true</strong>;
+<a name="92" href="#92">92</a> <strong class="jxr_keyword">this</strong>.useMac = useMac;
+<a name="93" href="#93">93</a> <strong class="jxr_keyword">this</strong>.saltValue = saltValue;
+<a name="94" href="#94">94</a> <strong class="jxr_keyword">if</strong> (iteration > 0) {
+<a name="95" href="#95">95</a> <strong class="jxr_keyword">this</strong>.iteration = iteration;
+<a name="96" href="#96">96</a> }
+<a name="97" href="#97">97</a> }
+<a name="98" href="#98">98</a>
+<a name="99" href="#99">99</a>
+<a name="100" href="#100">100</a> <em class="jxr_javadoccomment">/**</em>
+<a name="101" href="#101">101</a> <em class="jxr_javadoccomment"> * Get the derived secret key.</em>
+<a name="102" href="#102">102</a> <em class="jxr_javadoccomment"> * </em>
+<a name="103" href="#103">103</a> <em class="jxr_javadoccomment"> * After the <code>prepare()</code> method was called use this method</em>
+<a name="104" href="#104">104</a> <em class="jxr_javadoccomment"> * to compute a derived secret key. If "useDerivedKey" is set, then the returned secret</em>
+<a name="105" href="#105">105</a> <em class="jxr_javadoccomment"> * key is derived as per the UsernameToken 1.1 specification. Otherwise, the generation </em>
+<a name="106" href="#106">106</a> <em class="jxr_javadoccomment"> * of this secret key is according to the WS-Trust specifications.</em>
+<a name="107" href="#107">107</a> <em class="jxr_javadoccomment"> * </em>
+<a name="108" href="#108">108</a> <em class="jxr_javadoccomment"> * @return Return the derived secret key of this token or null if <code>prepare()</code></em>
+<a name="109" href="#109">109</a> <em class="jxr_javadoccomment"> * was not called before.</em>
+<a name="110" href="#110">110</a> <em class="jxr_javadoccomment"> */</em>
+<a name="111" href="#111">111</a> <strong class="jxr_keyword">public</strong> byte[] getSecretKey() <strong class="jxr_keyword">throws</strong> WSSecurityException {
+<a name="112" href="#112">112</a> <strong class="jxr_keyword">if</strong> (ut == <strong class="jxr_keyword">null</strong>) {
+<a name="113" href="#113">113</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="114" href="#114">114</a> }
+<a name="115" href="#115">115</a> <strong class="jxr_keyword">if</strong> (useDerivedKey) {
+<a name="116" href="#116">116</a> <strong class="jxr_keyword">return</strong> UsernameToken.generateDerivedKey(password, saltValue, iteration);
+<a name="117" href="#117">117</a> }
+<a name="118" href="#118">118</a> <strong class="jxr_keyword">return</strong> ut.getSecretKey();
+<a name="119" href="#119">119</a> }
+<a name="120" href="#120">120</a>
+<a name="121" href="#121">121</a> <em class="jxr_javadoccomment">/**</em>
+<a name="122" href="#122">122</a> <em class="jxr_javadoccomment"> * Get the derived key.</em>
+<a name="123" href="#123">123</a> <em class="jxr_javadoccomment"> * </em>
+<a name="124" href="#124">124</a> <em class="jxr_javadoccomment"> * After the <code>prepare()</code> method was called use this method</em>
+<a name="125" href="#125">125</a> <em class="jxr_javadoccomment"> * to compute a derived key. The generation of this secret key is according</em>
+<a name="126" href="#126">126</a> <em class="jxr_javadoccomment"> * to the UsernameTokenProfile 1.1 specification (section 4 - Key Derivation).</em>
+<a name="127" href="#127">127</a> <em class="jxr_javadoccomment"> * </em>
+<a name="128" href="#128">128</a> <em class="jxr_javadoccomment"> * @return Return the derived key of this token or null if <code>prepare()</code></em>
+<a name="129" href="#129">129</a> <em class="jxr_javadoccomment"> * was not called before.</em>
+<a name="130" href="#130">130</a> <em class="jxr_javadoccomment"> */</em>
+<a name="131" href="#131">131</a> <strong class="jxr_keyword">public</strong> byte[] getDerivedKey() <strong class="jxr_keyword">throws</strong> WSSecurityException {
+<a name="132" href="#132">132</a> <strong class="jxr_keyword">if</strong> (ut == <strong class="jxr_keyword">null</strong> || !useDerivedKey) {
+<a name="133" href="#133">133</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="134" href="#134">134</a> }
+<a name="135" href="#135">135</a> <strong class="jxr_keyword">return</strong> UsernameToken.generateDerivedKey(password, saltValue, iteration);
+<a name="136" href="#136">136</a> }
+<a name="137" href="#137">137</a>
+<a name="138" href="#138">138</a> <em class="jxr_javadoccomment">/**</em>
+<a name="139" href="#139">139</a> <em class="jxr_javadoccomment"> * Get the id generated during <code>prepare()</code>.</em>
+<a name="140" href="#140">140</a> <em class="jxr_javadoccomment"> * </em>
+<a name="141" href="#141">141</a> <em class="jxr_javadoccomment"> * Returns the the value of wsu:Id attribute of this UsernameToken. </em>
+<a name="142" href="#142">142</a> <em class="jxr_javadoccomment"> * </em>
+<a name="143" href="#143">143</a> <em class="jxr_javadoccomment"> * @return Return the wsu:Id of this token or null if <code>prepare()</code></em>
+<a name="144" href="#144">144</a> <em class="jxr_javadoccomment"> * was not called before.</em>
+<a name="145" href="#145">145</a> <em class="jxr_javadoccomment"> */</em>
+<a name="146" href="#146">146</a> <strong class="jxr_keyword">public</strong> String getId() {
+<a name="147" href="#147">147</a> <strong class="jxr_keyword">if</strong> (ut == <strong class="jxr_keyword">null</strong>) {
+<a name="148" href="#148">148</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="149" href="#149">149</a> }
+<a name="150" href="#150">150</a> <strong class="jxr_keyword">return</strong> ut.getID();
+<a name="151" href="#151">151</a> }
+<a name="152" href="#152">152</a>
+<a name="153" href="#153">153</a> <em class="jxr_javadoccomment">/**</em>
+<a name="154" href="#154">154</a> <em class="jxr_javadoccomment"> * Creates a Username token.</em>
+<a name="155" href="#155">155</a> <em class="jxr_javadoccomment"> * </em>
+<a name="156" href="#156">156</a> <em class="jxr_javadoccomment"> * The method prepares and initializes a WSSec UsernameToken structure after</em>
+<a name="157" href="#157">157</a> <em class="jxr_javadoccomment"> * the relevant information was set. A Before calling</em>
+<a name="158" href="#158">158</a> <em class="jxr_javadoccomment"> * <code>prepare()</code> all parameters such as user, password,</em>
+<a name="159" href="#159">159</a> <em class="jxr_javadoccomment"> * passwordType etc. must be set. A complete <code>UsernameToken</code> is</em>
+<a name="160" href="#160">160</a> <em class="jxr_javadoccomment"> * constructed.</em>
+<a name="161" href="#161">161</a> <em class="jxr_javadoccomment"> * </em>
+<a name="162" href="#162">162</a> <em class="jxr_javadoccomment"> * @param doc The SOAP envelope as W3C document</em>
+<a name="163" href="#163">163</a> <em class="jxr_javadoccomment"> */</em>
+<a name="164" href="#164">164</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prepare(Document doc) {
+<a name="165" href="#165">165</a> ut = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/UsernameToken.html">UsernameToken</a>(wssConfig.isPrecisionInMilliSeconds(), doc, passwordType);
+<a name="166" href="#166">166</a> ut.setName(user);
+<a name="167" href="#167">167</a> <strong class="jxr_keyword">if</strong> (useDerivedKey) {
+<a name="168" href="#168">168</a> saltValue = ut.addSalt(doc, saltValue, useMac);
+<a name="169" href="#169">169</a> ut.addIteration(doc, iteration);
+<a name="170" href="#170">170</a> } <strong class="jxr_keyword">else</strong> {
+<a name="171" href="#171">171</a> ut.setPassword(password);
+<a name="172" href="#172">172</a> }
+<a name="173" href="#173">173</a> <strong class="jxr_keyword">if</strong> (nonce) {
+<a name="174" href="#174">174</a> ut.addNonce(doc);
+<a name="175" href="#175">175</a> }
+<a name="176" href="#176">176</a> <strong class="jxr_keyword">if</strong> (created) {
+<a name="177" href="#177">177</a> ut.addCreated(wssConfig.isPrecisionInMilliSeconds(), doc);
+<a name="178" href="#178">178</a> }
+<a name="179" href="#179">179</a> ut.setID(wssConfig.getIdAllocator().createId(<span class="jxr_string">"UsernameToken-"</span>, ut));
+<a name="180" href="#180">180</a> }
+<a name="181" href="#181">181</a>
+<a name="182" href="#182">182</a> <em class="jxr_javadoccomment">/**</em>
+<a name="183" href="#183">183</a> <em class="jxr_javadoccomment"> * Prepends the UsernameToken element to the elements already in the</em>
+<a name="184" href="#184">184</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="185" href="#185">185</a> <em class="jxr_javadoccomment"> * </em>
+<a name="186" href="#186">186</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
+<a name="187" href="#187">187</a> <em class="jxr_javadoccomment"> * This allows to insert the UsernameToken element at any position in the</em>
+<a name="188" href="#188">188</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="189" href="#189">189</a> <em class="jxr_javadoccomment"> * </em>
+<a name="190" href="#190">190</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
+<a name="191" href="#191">191</a> <em class="jxr_javadoccomment"> */</em>
+<a name="192" href="#192">192</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> prependToHeader(<a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
+<a name="193" href="#193">193</a> WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), ut.getElement());
+<a name="194" href="#194">194</a> }
+<a name="195" href="#195">195</a>
+<a name="196" href="#196">196</a> <em class="jxr_javadoccomment">/**</em>
+<a name="197" href="#197">197</a> <em class="jxr_javadoccomment"> * Appends the UsernameToken element to the elements already in the</em>
+<a name="198" href="#198">198</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="199" href="#199">199</a> <em class="jxr_javadoccomment"> * </em>
+<a name="200" href="#200">200</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
+<a name="201" href="#201">201</a> <em class="jxr_javadoccomment"> * This allows to insert the UsernameToken element at any position in the</em>
+<a name="202" href="#202">202</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="203" href="#203">203</a> <em class="jxr_javadoccomment"> * </em>
+<a name="204" href="#204">204</a> <em class="jxr_javadoccomment"> * @param secHeader The security header that holds the Signature element.</em>
+<a name="205" href="#205">205</a> <em class="jxr_javadoccomment"> */</em>
+<a name="206" href="#206">206</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> appendToHeader(<a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
+<a name="207" href="#207">207</a> Element secHeaderElement = secHeader.getSecurityHeader();
+<a name="208" href="#208">208</a> secHeaderElement.appendChild(ut.getElement());
+<a name="209" href="#209">209</a> }
+<a name="210" href="#210">210</a>
+<a name="211" href="#211">211</a> <em class="jxr_javadoccomment">/**</em>
+<a name="212" href="#212">212</a> <em class="jxr_javadoccomment"> * Adds a new <code>UsernameToken</code> to a soap envelope.</em>
+<a name="213" href="#213">213</a> <em class="jxr_javadoccomment"> * </em>
+<a name="214" href="#214">214</a> <em class="jxr_javadoccomment"> * Before calling <code>build()</code> all parameters such as user,</em>
+<a name="215" href="#215">215</a> <em class="jxr_javadoccomment"> * password, passwordType etc. must be set. A complete</em>
+<a name="216" href="#216">216</a> <em class="jxr_javadoccomment"> * <code>UsernameToken</code> is constructed and added to the</em>
+<a name="217" href="#217">217</a> <em class="jxr_javadoccomment"> * <code>wsse:Security</code> header.</em>
+<a name="218" href="#218">218</a> <em class="jxr_javadoccomment"> * </em>
+<a name="219" href="#219">219</a> <em class="jxr_javadoccomment"> * @param doc The SOAP envelope as W3C document</em>
+<a name="220" href="#220">220</a> <em class="jxr_javadoccomment"> * @param secHeader The security header inside the SOAP envelope</em>
+<a name="221" href="#221">221</a> <em class="jxr_javadoccomment"> * @return Document with UsernameToken added</em>
+<a name="222" href="#222">222</a> <em class="jxr_javadoccomment"> */</em>
+<a name="223" href="#223">223</a> <strong class="jxr_keyword">public</strong> Document build(Document doc, <a href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a> secHeader) {
+<a name="224" href="#224">224</a> log.debug(<span class="jxr_string">"Begin add username token..."</span>);
+<a name="225" href="#225">225</a>
+<a name="226" href="#226">226</a> prepare(doc);
+<a name="227" href="#227">227</a> prependToHeader(secHeader);
+<a name="228" href="#228">228</a>
+<a name="229" href="#229">229</a> <strong class="jxr_keyword">return</strong> doc;
+<a name="230" href="#230">230</a> }
+<a name="231" href="#231">231</a>
+<a name="232" href="#232">232</a> <em class="jxr_javadoccomment">/**</em>
+<a name="233" href="#233">233</a> <em class="jxr_javadoccomment"> * Returns the <code>UsernameToken</code> element.</em>
+<a name="234" href="#234">234</a> <em class="jxr_javadoccomment"> * </em>
+<a name="235" href="#235">235</a> <em class="jxr_javadoccomment"> * The method can be called any time after <code>prepare()</code>.</em>
+<a name="236" href="#236">236</a> <em class="jxr_javadoccomment"> * This allows to insert the UsernameToken element at any position in the</em>
+<a name="237" href="#237">237</a> <em class="jxr_javadoccomment"> * Security header.</em>
+<a name="238" href="#238">238</a> <em class="jxr_javadoccomment"> * </em>
+<a name="239" href="#239">239</a> <em class="jxr_javadoccomment"> * @return the Username Token element</em>
+<a name="240" href="#240">240</a> <em class="jxr_javadoccomment"> */</em>
+<a name="241" href="#241">241</a> <strong class="jxr_keyword">public</strong> Element getUsernameTokenElement() {
+<a name="242" href="#242">242</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>.ut.getElement();
+<a name="243" href="#243">243</a> }
+<a name="244" href="#244">244</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/message/WSSignEnvelope.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/WSSignEnvelope.html?rev=766696&r1=766695&r2=766696&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/message/WSSignEnvelope.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/message/WSSignEnvelope.html Mon Apr 20 13:56:25 2009
@@ -250,7 +250,7 @@
<a name="240" href="#240">240</a> <em class="jxr_comment"> * Gather some info about the document to process and store it for</em>
<a name="241" href="#241">241</a> <em class="jxr_comment"> * retrieval</em>
<a name="242" href="#242">242</a> <em class="jxr_comment"> */</em>
-<a name="243" href="#243">243</a> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> wsDocInfo = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a>(doc.hashCode());
+<a name="243" href="#243">243</a> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> wsDocInfo = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a>(doc);
<a name="244" href="#244">244</a> wsDocInfo.setCrypto(crypto);
<a name="245" href="#245">245</a>
<a name="246" href="#246">246</a> Element envelope = doc.getDocumentElement();
@@ -271,7 +271,7 @@
<a name="261" href="#261">261</a> <strong class="jxr_keyword">new</strong> Object[] { user, <span class="jxr_string">"signature"</span> }
<a name="262" href="#262">262</a> );
<a name="263" href="#263">263</a> }
-<a name="264" href="#264">264</a> certUri = <span class="jxr_string">"CertId-"</span> + certs[0].hashCode();
+<a name="264" href="#264">264</a> certUri = wssConfig.getIdAllocator().createSecureId(<span class="jxr_string">"CertId-"</span>, certs[0]);
<a name="265" href="#265">265</a> <strong class="jxr_keyword">if</strong> (sigAlgo == <strong class="jxr_keyword">null</strong>) {
<a name="266" href="#266">266</a> String pubKeyAlgo = certs[0].getPublicKey().getAlgorithm();
<a name="267" href="#267">267</a> log.debug(<span class="jxr_string">"automatic sig algo detection: "</span> + pubKeyAlgo);
@@ -336,12 +336,12 @@
<a name="326" href="#326">326</a> <em class="jxr_comment"> */</em>
<a name="327" href="#327">327</a>
<a name="328" href="#328">328</a> KeyInfo info = sig.getKeyInfo();
-<a name="329" href="#329">329</a> String keyInfoUri = <span class="jxr_string">"KeyId-"</span> + info.hashCode();
+<a name="329" href="#329">329</a> String keyInfoUri = wssConfig.getIdAllocator().createSecureId(<span class="jxr_string">"KeyId-"</span>, info);
<a name="330" href="#330">330</a> info.setId(keyInfoUri);
<a name="331" href="#331">331</a>
<a name="332" href="#332">332</a> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a>(doc);
-<a name="333" href="#333">333</a> String strUri = <span class="jxr_string">"STRId-"</span> + secRef.hashCode();
-<a name="334" href="#334">334</a> secRef.setID(strUri);
+<a name="333" href="#333">333</a> String secRefId = wssConfig.getIdAllocator().createSecureId(<span class="jxr_string">"STRId-"</span>, info);
+<a name="334" href="#334">334</a> secRef.setID(secRefId);
<a name="335" href="#335">335</a>
<a name="336" href="#336">336</a> <strong class="jxr_keyword">if</strong> (tlog.isDebugEnabled()) {
<a name="337" href="#337">337</a> t1 = System.currentTimeMillis();
@@ -425,7 +425,7 @@
<a name="415" href="#415">415</a> transforms = <strong class="jxr_keyword">new</strong> Transforms(doc);
<a name="416" href="#416">416</a> transforms.addTransform(
<a name="417" href="#417">417</a> STRTransform.implementedTransformURI, ctx);
-<a name="418" href="#418">418</a> sig.addDocument(<span class="jxr_string">"#"</span> + strUri, transforms);
+<a name="418" href="#418">418</a> sig.addDocument(<span class="jxr_string">"#"</span> + secRefId, transforms);
<a name="419" href="#419">419</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (elemName.equals(<span class="jxr_string">"Assertion"</span>)) { <em class="jxr_comment">// Assertion</em>
<a name="420" href="#420">420</a>
<a name="421" href="#421">421</a> String id = <strong class="jxr_keyword">null</strong>;
@@ -531,7 +531,7 @@
<a name="521" href="#521">521</a> refUt.setValueType(WSConstants.USERNAMETOKEN_NS + <span class="jxr_string">"#UsernameToken"</span>);
<a name="522" href="#522">522</a> String utId = usernameToken.getId();
<a name="523" href="#523">523</a> <strong class="jxr_keyword">if</strong> (utId == <strong class="jxr_keyword">null</strong>) {
-<a name="524" href="#524">524</a> utId = <span class="jxr_string">"usernameTokenId-"</span> + usernameToken.hashCode();
+<a name="524" href="#524">524</a> utId = wssConfig.getIdAllocator().createId(<span class="jxr_string">"usernameTokenId-"</span>, usernameToken);
<a name="525" href="#525">525</a> usernameToken.setId(utId);
<a name="526" href="#526">526</a> }
<a name="527" href="#527">527</a> refUt.setURI(<span class="jxr_string">"#"</span> + utId);
@@ -552,7 +552,7 @@
<a name="542" href="#542">542</a> }
<a name="543" href="#543">543</a> info.addUnknownElement(secRef.getElement());
<a name="544" href="#544">544</a>
-<a name="545" href="#545">545</a> WSDocInfoStore.store(wsDocInfo);
+<a name="545" href="#545">545</a> <strong class="jxr_keyword">boolean</strong> remove = WSDocInfoStore.store(wsDocInfo);
<a name="546" href="#546">546</a> <strong class="jxr_keyword">try</strong> {
<a name="547" href="#547">547</a> <strong class="jxr_keyword">if</strong> (keyIdentifierType == WSConstants.UT_SIGNING) {
<a name="548" href="#548">548</a> sig.sign(sig.createSecretKey(secretKey));
@@ -567,93 +567,95 @@
<a name="557" href="#557">557</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(WSSecurityException.FAILED_SIGNATURE,
<a name="558" href="#558">558</a> <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, e1);
<a name="559" href="#559">559</a> } <strong class="jxr_keyword">finally</strong> {
-<a name="560" href="#560">560</a> WSDocInfoStore.delete(wsDocInfo);
-<a name="561" href="#561">561</a> }
-<a name="562" href="#562">562</a> <strong class="jxr_keyword">if</strong> (tlog.isDebugEnabled()) {
-<a name="563" href="#563">563</a> t4 = System.currentTimeMillis();
-<a name="564" href="#564">564</a> tlog.debug(<span class="jxr_string">"SignEnvelope: cre-Sig= "</span> + (t1 - t0)
-<a name="565" href="#565">565</a> + <span class="jxr_string">" set transform= "</span> + (t2 - t1) + <span class="jxr_string">" sec-ref= "</span> + (t3 - t2)
-<a name="566" href="#566">566</a> + <span class="jxr_string">" signature= "</span> + (t4 - t3));
-<a name="567" href="#567">567</a> }
-<a name="568" href="#568">568</a> <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="569" href="#569">569</a> log.debug(<span class="jxr_string">"Signing complete."</span>);
-<a name="570" href="#570">570</a> }
-<a name="571" href="#571">571</a> <strong class="jxr_keyword">return</strong> (doc);
-<a name="572" href="#572">572</a> }
-<a name="573" href="#573">573</a>
-<a name="574" href="#574">574</a> <strong class="jxr_keyword">protected</strong> Element createSTRParameter(Document doc) {
-<a name="575" href="#575">575</a> Element transformParam = doc.createElementNS(WSConstants.WSSE_NS,
-<a name="576" href="#576">576</a> WSConstants.WSSE_PREFIX + <span class="jxr_string">":TransformationParameters"</span>);
-<a name="577" href="#577">577</a>
-<a name="578" href="#578">578</a> WSSecurityUtil.setNamespace(transformParam, WSConstants.WSSE_NS,
-<a name="579" href="#579">579</a> WSConstants.WSSE_PREFIX);
-<a name="580" href="#580">580</a>
-<a name="581" href="#581">581</a> Element canonElem = doc.createElementNS(WSConstants.SIG_NS,
-<a name="582" href="#582">582</a> WSConstants.SIG_PREFIX + <span class="jxr_string">":CanonicalizationMethod"</span>);
-<a name="583" href="#583">583</a>
-<a name="584" href="#584">584</a> WSSecurityUtil.setNamespace(canonElem, WSConstants.SIG_NS,
-<a name="585" href="#585">585</a> WSConstants.SIG_PREFIX);
-<a name="586" href="#586">586</a>
-<a name="587" href="#587">587</a> canonElem.setAttributeNS(<strong class="jxr_keyword">null</strong>, <span class="jxr_string">"Algorithm"</span>,
-<a name="588" href="#588">588</a> Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-<a name="589" href="#589">589</a> transformParam.appendChild(canonElem);
-<a name="590" href="#590">590</a> <strong class="jxr_keyword">return</strong> transformParam;
-<a name="591" href="#591">591</a> }
-<a name="592" href="#592">592</a>
-<a name="593" href="#593">593</a> <strong class="jxr_keyword">protected</strong> Set getInclusivePrefixes(Element target) {
-<a name="594" href="#594">594</a> <strong class="jxr_keyword">return</strong> getInclusivePrefixes(target, <strong class="jxr_keyword">true</strong>);
-<a name="595" href="#595">595</a> }
-<a name="596" href="#596">596</a>
-<a name="597" href="#597">597</a> <strong class="jxr_keyword">protected</strong> Set getInclusivePrefixes(Element target, <strong class="jxr_keyword">boolean</strong> excludeVisible) {
-<a name="598" href="#598">598</a> Set result = <strong class="jxr_keyword">new</strong> HashSet();
-<a name="599" href="#599">599</a> Node parent = target;
-<a name="600" href="#600">600</a> NamedNodeMap attributes;
-<a name="601" href="#601">601</a> Node attribute;
-<a name="602" href="#602">602</a> <strong class="jxr_keyword">while</strong> (!(parent.getParentNode() instanceof Document)) {
-<a name="603" href="#603">603</a> parent = parent.getParentNode();
-<a name="604" href="#604">604</a> attributes = parent.getAttributes();
-<a name="605" href="#605">605</a> <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i < attributes.getLength(); i++) {
-<a name="606" href="#606">606</a> attribute = attributes.item(i);
-<a name="607" href="#607">607</a> <strong class="jxr_keyword">if</strong> (attribute.getNamespaceURI() != <strong class="jxr_keyword">null</strong>
-<a name="608" href="#608">608</a> && attribute.getNamespaceURI().equals(
-<a name="609" href="#609">609</a> org.apache.ws.security.WSConstants.XMLNS_NS)) {
-<a name="610" href="#610">610</a> <strong class="jxr_keyword">if</strong> (attribute.getNodeName().equals(<span class="jxr_string">"xmlns"</span>)) {
-<a name="611" href="#611">611</a> result.add(<span class="jxr_string">"#default"</span>);
-<a name="612" href="#612">612</a> } <strong class="jxr_keyword">else</strong> {
-<a name="613" href="#613">613</a> result.add(attribute.getLocalName());
-<a name="614" href="#614">614</a> }
-<a name="615" href="#615">615</a> }
-<a name="616" href="#616">616</a> }
-<a name="617" href="#617">617</a> }
-<a name="618" href="#618">618</a>
-<a name="619" href="#619">619</a> <strong class="jxr_keyword">if</strong> (excludeVisible == <strong class="jxr_keyword">true</strong>) {
-<a name="620" href="#620">620</a> attributes = target.getAttributes();
-<a name="621" href="#621">621</a> <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i < attributes.getLength(); i++) {
-<a name="622" href="#622">622</a> attribute = attributes.item(i);
-<a name="623" href="#623">623</a> <strong class="jxr_keyword">if</strong> (attribute.getNamespaceURI() != <strong class="jxr_keyword">null</strong>
-<a name="624" href="#624">624</a> && attribute.getNamespaceURI().equals(
-<a name="625" href="#625">625</a> org.apache.ws.security.WSConstants.XMLNS_NS)) {
-<a name="626" href="#626">626</a> <strong class="jxr_keyword">if</strong> (attribute.getNodeName().equals(<span class="jxr_string">"xmlns"</span>)) {
-<a name="627" href="#627">627</a> result.remove(<span class="jxr_string">"#default"</span>);
-<a name="628" href="#628">628</a> } <strong class="jxr_keyword">else</strong> {
-<a name="629" href="#629">629</a> result.remove(attribute.getLocalName());
-<a name="630" href="#630">630</a> }
-<a name="631" href="#631">631</a> }
-<a name="632" href="#632">632</a> <strong class="jxr_keyword">if</strong> (attribute.getPrefix() != <strong class="jxr_keyword">null</strong>) {
-<a name="633" href="#633">633</a> result.remove(attribute.getPrefix());
-<a name="634" href="#634">634</a> }
-<a name="635" href="#635">635</a> }
-<a name="636" href="#636">636</a>
-<a name="637" href="#637">637</a> <strong class="jxr_keyword">if</strong> (target.getPrefix() == <strong class="jxr_keyword">null</strong>) {
-<a name="638" href="#638">638</a> result.remove(<span class="jxr_string">"#default"</span>);
-<a name="639" href="#639">639</a> } <strong class="jxr_keyword">else</strong> {
-<a name="640" href="#640">640</a> result.remove(target.getPrefix());
-<a name="641" href="#641">641</a> }
-<a name="642" href="#642">642</a> }
-<a name="643" href="#643">643</a>
-<a name="644" href="#644">644</a> <strong class="jxr_keyword">return</strong> result;
-<a name="645" href="#645">645</a> }
-<a name="646" href="#646">646</a> }
+<a name="560" href="#560">560</a> <strong class="jxr_keyword">if</strong> (remove) {
+<a name="561" href="#561">561</a> WSDocInfoStore.delete(wsDocInfo);
+<a name="562" href="#562">562</a> }
+<a name="563" href="#563">563</a> }
+<a name="564" href="#564">564</a> <strong class="jxr_keyword">if</strong> (tlog.isDebugEnabled()) {
+<a name="565" href="#565">565</a> t4 = System.currentTimeMillis();
+<a name="566" href="#566">566</a> tlog.debug(<span class="jxr_string">"SignEnvelope: cre-Sig= "</span> + (t1 - t0)
+<a name="567" href="#567">567</a> + <span class="jxr_string">" set transform= "</span> + (t2 - t1) + <span class="jxr_string">" sec-ref= "</span> + (t3 - t2)
+<a name="568" href="#568">568</a> + <span class="jxr_string">" signature= "</span> + (t4 - t3));
+<a name="569" href="#569">569</a> }
+<a name="570" href="#570">570</a> <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="571" href="#571">571</a> log.debug(<span class="jxr_string">"Signing complete."</span>);
+<a name="572" href="#572">572</a> }
+<a name="573" href="#573">573</a> <strong class="jxr_keyword">return</strong> (doc);
+<a name="574" href="#574">574</a> }
+<a name="575" href="#575">575</a>
+<a name="576" href="#576">576</a> <strong class="jxr_keyword">protected</strong> Element createSTRParameter(Document doc) {
+<a name="577" href="#577">577</a> Element transformParam = doc.createElementNS(WSConstants.WSSE_NS,
+<a name="578" href="#578">578</a> WSConstants.WSSE_PREFIX + <span class="jxr_string">":TransformationParameters"</span>);
+<a name="579" href="#579">579</a>
+<a name="580" href="#580">580</a> WSSecurityUtil.setNamespace(transformParam, WSConstants.WSSE_NS,
+<a name="581" href="#581">581</a> WSConstants.WSSE_PREFIX);
+<a name="582" href="#582">582</a>
+<a name="583" href="#583">583</a> Element canonElem = doc.createElementNS(WSConstants.SIG_NS,
+<a name="584" href="#584">584</a> WSConstants.SIG_PREFIX + <span class="jxr_string">":CanonicalizationMethod"</span>);
+<a name="585" href="#585">585</a>
+<a name="586" href="#586">586</a> WSSecurityUtil.setNamespace(canonElem, WSConstants.SIG_NS,
+<a name="587" href="#587">587</a> WSConstants.SIG_PREFIX);
+<a name="588" href="#588">588</a>
+<a name="589" href="#589">589</a> canonElem.setAttributeNS(<strong class="jxr_keyword">null</strong>, <span class="jxr_string">"Algorithm"</span>,
+<a name="590" href="#590">590</a> Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+<a name="591" href="#591">591</a> transformParam.appendChild(canonElem);
+<a name="592" href="#592">592</a> <strong class="jxr_keyword">return</strong> transformParam;
+<a name="593" href="#593">593</a> }
+<a name="594" href="#594">594</a>
+<a name="595" href="#595">595</a> <strong class="jxr_keyword">protected</strong> Set getInclusivePrefixes(Element target) {
+<a name="596" href="#596">596</a> <strong class="jxr_keyword">return</strong> getInclusivePrefixes(target, <strong class="jxr_keyword">true</strong>);
+<a name="597" href="#597">597</a> }
+<a name="598" href="#598">598</a>
+<a name="599" href="#599">599</a> <strong class="jxr_keyword">protected</strong> Set getInclusivePrefixes(Element target, <strong class="jxr_keyword">boolean</strong> excludeVisible) {
+<a name="600" href="#600">600</a> Set result = <strong class="jxr_keyword">new</strong> HashSet();
+<a name="601" href="#601">601</a> Node parent = target;
+<a name="602" href="#602">602</a> NamedNodeMap attributes;
+<a name="603" href="#603">603</a> Node attribute;
+<a name="604" href="#604">604</a> <strong class="jxr_keyword">while</strong> (!(parent.getParentNode() instanceof Document)) {
+<a name="605" href="#605">605</a> parent = parent.getParentNode();
+<a name="606" href="#606">606</a> attributes = parent.getAttributes();
+<a name="607" href="#607">607</a> <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i < attributes.getLength(); i++) {
+<a name="608" href="#608">608</a> attribute = attributes.item(i);
+<a name="609" href="#609">609</a> <strong class="jxr_keyword">if</strong> (attribute.getNamespaceURI() != <strong class="jxr_keyword">null</strong>
+<a name="610" href="#610">610</a> && attribute.getNamespaceURI().equals(
+<a name="611" href="#611">611</a> org.apache.ws.security.WSConstants.XMLNS_NS)) {
+<a name="612" href="#612">612</a> <strong class="jxr_keyword">if</strong> (attribute.getNodeName().equals(<span class="jxr_string">"xmlns"</span>)) {
+<a name="613" href="#613">613</a> result.add(<span class="jxr_string">"#default"</span>);
+<a name="614" href="#614">614</a> } <strong class="jxr_keyword">else</strong> {
+<a name="615" href="#615">615</a> result.add(attribute.getLocalName());
+<a name="616" href="#616">616</a> }
+<a name="617" href="#617">617</a> }
+<a name="618" href="#618">618</a> }
+<a name="619" href="#619">619</a> }
+<a name="620" href="#620">620</a>
+<a name="621" href="#621">621</a> <strong class="jxr_keyword">if</strong> (excludeVisible == <strong class="jxr_keyword">true</strong>) {
+<a name="622" href="#622">622</a> attributes = target.getAttributes();
+<a name="623" href="#623">623</a> <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i < attributes.getLength(); i++) {
+<a name="624" href="#624">624</a> attribute = attributes.item(i);
+<a name="625" href="#625">625</a> <strong class="jxr_keyword">if</strong> (attribute.getNamespaceURI() != <strong class="jxr_keyword">null</strong>
+<a name="626" href="#626">626</a> && attribute.getNamespaceURI().equals(
+<a name="627" href="#627">627</a> org.apache.ws.security.WSConstants.XMLNS_NS)) {
+<a name="628" href="#628">628</a> <strong class="jxr_keyword">if</strong> (attribute.getNodeName().equals(<span class="jxr_string">"xmlns"</span>)) {
+<a name="629" href="#629">629</a> result.remove(<span class="jxr_string">"#default"</span>);
+<a name="630" href="#630">630</a> } <strong class="jxr_keyword">else</strong> {
+<a name="631" href="#631">631</a> result.remove(attribute.getLocalName());
+<a name="632" href="#632">632</a> }
+<a name="633" href="#633">633</a> }
+<a name="634" href="#634">634</a> <strong class="jxr_keyword">if</strong> (attribute.getPrefix() != <strong class="jxr_keyword">null</strong>) {
+<a name="635" href="#635">635</a> result.remove(attribute.getPrefix());
+<a name="636" href="#636">636</a> }
+<a name="637" href="#637">637</a> }
+<a name="638" href="#638">638</a>
+<a name="639" href="#639">639</a> <strong class="jxr_keyword">if</strong> (target.getPrefix() == <strong class="jxr_keyword">null</strong>) {
+<a name="640" href="#640">640</a> result.remove(<span class="jxr_string">"#default"</span>);
+<a name="641" href="#641">641</a> } <strong class="jxr_keyword">else</strong> {
+<a name="642" href="#642">642</a> result.remove(target.getPrefix());
+<a name="643" href="#643">643</a> }
+<a name="644" href="#644">644</a> }
+<a name="645" href="#645">645</a>
+<a name="646" href="#646">646</a> <strong class="jxr_keyword">return</strong> result;
+<a name="647" href="#647">647</a> }
+<a name="648" href="#648">648</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/message/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/package-frame.html?rev=766696&r1=766695&r2=766696&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/message/package-frame.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/message/package-frame.html Mon Apr 20 13:56:25 2009
@@ -3,7 +3,7 @@
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
- <title>WSS4J 1.5.6 Reference Package org.apache.ws.security.message</title>
+ <title>WSS4J 1.5.7 Reference Package org.apache.ws.security.message</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
</head>
<body>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/message/package-summary.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/package-summary.html?rev=766696&r1=766695&r2=766696&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/message/package-summary.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/message/package-summary.html Mon Apr 20 13:56:25 2009
@@ -3,7 +3,7 @@
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
- <title>WSS4J 1.5.6 Reference Package org.apache.ws.security.message</title>
+ <title>WSS4J 1.5.7 Reference Package org.apache.ws.security.message</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
</head>
<body>
---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org