Modified: 
webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecDerivedKeyBase.html
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecDerivedKeyBase.html?rev=1133081&r1=1133080&r2=1133081&view=diff
==============================================================================
--- 
webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecDerivedKeyBase.html
 (original)
+++ 
webservices/wss4j/site/xref/org/apache/ws/security/message/WSSecDerivedKeyBase.html
 Tue Jun  7 16:25:20 2011
@@ -232,73 +232,98 @@
 <a name="222" href="#222">222</a>         dkt.setID(dktId);
 <a name="223" href="#223">223</a>         
 <a name="224" href="#224">224</a>         <strong 
class="jxr_keyword">if</strong> (strElem == <strong 
class="jxr_keyword">null</strong>) {
-<a name="225" href="#225">225</a>             <em class="jxr_comment">//Create 
the SecurityTokenRef to the Encrypted Key</em>
-<a name="226" href="#226">226</a>             <a 
href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a>
 strEncKey = <strong class="jxr_keyword">new</strong> <a 
href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a>(document);
-<a name="227" href="#227">227</a>             <a 
href="../../../../../org/apache/ws/security/message/token/Reference.html">Reference</a>
 ref = <strong class="jxr_keyword">new</strong> <a 
href="../../../../../org/apache/ws/security/message/token/Reference.html">Reference</a>(document);
+<a name="225" href="#225">225</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>(document);
+<a name="226" href="#226">226</a>             String strUri = 
getWsConfig().getIdAllocator().createSecureId(<span 
class="jxr_string">"STR-"</span>, secRef);
+<a name="227" href="#227">227</a>             secRef.setID(strUri);
 <a name="228" href="#228">228</a>             
-<a name="229" href="#229">229</a>             <strong 
class="jxr_keyword">if</strong> (tokenIdDirectId) {
-<a name="230" href="#230">230</a>                 ref.setURI(tokenIdentifier);
-<a name="231" href="#231">231</a>             } <strong 
class="jxr_keyword">else</strong> {
-<a name="232" href="#232">232</a>                 ref.setURI(<span 
class="jxr_string">"#"</span> + tokenIdentifier);
-<a name="233" href="#233">233</a>             }
-<a name="234" href="#234">234</a>             <strong 
class="jxr_keyword">if</strong> (customValueType != <strong 
class="jxr_keyword">null</strong> &amp;&amp; !<span 
class="jxr_string">""</span>.equals(customValueType)) {
-<a name="235" href="#235">235</a>                 
ref.setValueType(customValueType);
-<a name="236" href="#236">236</a>             }
-<a name="237" href="#237">237</a>             <strong 
class="jxr_keyword">if</strong> 
(!WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE.equals(customValueType)) {
-<a name="238" href="#238">238</a>                 
strEncKey.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
-<a name="239" href="#239">239</a>             }
-<a name="240" href="#240">240</a>             strEncKey.setReference(ref);
-<a name="241" href="#241">241</a>             
dkt.setSecurityTokenReference(strEncKey); 
-<a name="242" href="#242">242</a>         } <strong 
class="jxr_keyword">else</strong> {
-<a name="243" href="#243">243</a>             
dkt.setSecurityTokenReference(strElem);
-<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 name="248" href="#248">248</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="249" href="#249">249</a> <em class="jxr_javadoccomment">     * 
Prepend the DerivedKey element to the elements already in the Security</em>
-<a name="250" href="#250">250</a> <em class="jxr_javadoccomment">     * 
header.</em>
-<a name="251" href="#251">251</a> <em class="jxr_javadoccomment">     * </em>
-<a name="252" href="#252">252</a> <em class="jxr_javadoccomment">     * The 
method can be called any time after &lt;code&gt;prepare()&lt;/code&gt;. 
This</em>
-<a name="253" href="#253">253</a> <em class="jxr_javadoccomment">     * allows 
to insert the DerivedKey element at any position in the Security</em>
-<a name="254" href="#254">254</a> <em class="jxr_javadoccomment">     * 
header.</em>
-<a name="255" href="#255">255</a> <em class="jxr_javadoccomment">     * </em>
-<a name="256" href="#256">256</a> <em class="jxr_javadoccomment">     * @param 
secHeader The security header that holds the Signature element.</em>
-<a name="257" href="#257">257</a> <em class="jxr_javadoccomment">     */</em>
-<a name="258" href="#258">258</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
prependDKElementToHeader(<a 
href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a>
 secHeader) {
-<a name="259" href="#259">259</a>         WSSecurityUtil.prependChildElement(
-<a name="260" href="#260">260</a>             secHeader.getSecurityHeader(), 
dkt.getElement()
-<a name="261" href="#261">261</a>         );
-<a name="262" href="#262">262</a>     }
-<a name="263" href="#263">263</a>     
-<a name="264" href="#264">264</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
appendDKElementToHeader(<a 
href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a>
 secHeader) {
-<a name="265" href="#265">265</a>         Element secHeaderElement = 
secHeader.getSecurityHeader();
-<a name="266" href="#266">266</a>         
secHeaderElement.appendChild(dkt.getElement());
-<a name="267" href="#267">267</a>     }
-<a name="268" href="#268">268</a> 
-<a name="269" href="#269">269</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="270" href="#270">270</a> <em class="jxr_javadoccomment">     * @param 
wscVersion The wscVersion to set.</em>
-<a name="271" href="#271">271</a> <em class="jxr_javadoccomment">     */</em>
-<a name="272" href="#272">272</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
setWscVersion(<strong class="jxr_keyword">int</strong> wscVersion) {
-<a name="273" href="#273">273</a>         <strong 
class="jxr_keyword">this</strong>.wscVersion = wscVersion;
-<a name="274" href="#274">274</a>     }
-<a name="275" href="#275">275</a>     
-<a name="276" href="#276">276</a>     <strong 
class="jxr_keyword">public</strong> Element getdktElement() {
-<a name="277" href="#277">277</a>         <strong 
class="jxr_keyword">return</strong> dkt.getElement();
-<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">public</strong> <strong class="jxr_keyword">void</strong> 
setDerivedKeyLength(<strong class="jxr_keyword">int</strong> keyLength) {
-<a name="281" href="#281">281</a>         derivedKeyLength = keyLength;
-<a name="282" href="#282">282</a>     }
-<a name="283" href="#283">283</a> 
-<a name="284" href="#284">284</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
setCustomValueType(String customValueType) {
-<a name="285" href="#285">285</a>         <strong 
class="jxr_keyword">this</strong>.customValueType = customValueType;
-<a name="286" href="#286">286</a>     }
-<a name="287" href="#287">287</a>     
-<a name="288" href="#288">288</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
setTokenIdDirectId(<strong class="jxr_keyword">boolean</strong> b) {
-<a name="289" href="#289">289</a>         tokenIdDirectId = b;
-<a name="290" href="#290">290</a>     }
-<a name="291" href="#291">291</a> }
+<a name="229" href="#229">229</a>             <strong 
class="jxr_keyword">switch</strong> (keyIdentifierType) {
+<a name="230" href="#230">230</a>             <strong 
class="jxr_keyword">case</strong> WSConstants.CUSTOM_KEY_IDENTIFIER:
+<a name="231" href="#231">231</a>                 
secRef.setKeyIdentifier(customValueType, tokenIdentifier);
+<a name="232" href="#232">232</a>                 <strong 
class="jxr_keyword">if</strong> 
(WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(customValueType)) {
+<a name="233" href="#233">233</a>                     
secRef.addTokenType(WSConstants.WSS_SAML_TOKEN_TYPE);
+<a name="234" href="#234">234</a>                 } <strong 
class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> 
(WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(customValueType)) {
+<a name="235" href="#235">235</a>                     
secRef.addTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
+<a name="236" href="#236">236</a>                 } <strong 
class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> 
(WSConstants.WSS_ENC_KEY_VALUE_TYPE.equals(customValueType)) {
+<a name="237" href="#237">237</a>                     
secRef.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
+<a name="238" href="#238">238</a>                 }
+<a name="239" href="#239">239</a>                 <strong 
class="jxr_keyword">break</strong>;
+<a name="240" href="#240">240</a>             <strong 
class="jxr_keyword">default</strong>:
+<a name="241" href="#241">241</a>                 <a 
href="../../../../../org/apache/ws/security/message/token/Reference.html">Reference</a>
 ref = <strong class="jxr_keyword">new</strong> <a 
href="../../../../../org/apache/ws/security/message/token/Reference.html">Reference</a>(document);
+<a name="242" href="#242">242</a>                 
+<a name="243" href="#243">243</a>                 <strong 
class="jxr_keyword">if</strong> (tokenIdDirectId) {
+<a name="244" href="#244">244</a>                     
ref.setURI(tokenIdentifier);
+<a name="245" href="#245">245</a>                 } <strong 
class="jxr_keyword">else</strong> {
+<a name="246" href="#246">246</a>                     ref.setURI(<span 
class="jxr_string">"#"</span> + tokenIdentifier);
+<a name="247" href="#247">247</a>                 }
+<a name="248" href="#248">248</a>                 <strong 
class="jxr_keyword">if</strong> (customValueType != <strong 
class="jxr_keyword">null</strong> &amp;&amp; !<span 
class="jxr_string">""</span>.equals(customValueType)) {
+<a name="249" href="#249">249</a>                     
ref.setValueType(customValueType);
+<a name="250" href="#250">250</a>                 } 
+<a name="251" href="#251">251</a>                 <strong 
class="jxr_keyword">if</strong> 
(WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(customValueType)) {
+<a name="252" href="#252">252</a>                     
secRef.addTokenType(WSConstants.WSS_SAML_TOKEN_TYPE);
+<a name="253" href="#253">253</a>                     
ref.setValueType(customValueType);
+<a name="254" href="#254">254</a>                 } <strong 
class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> 
(WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(customValueType)) {
+<a name="255" href="#255">255</a>                     
secRef.addTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
+<a name="256" href="#256">256</a>                 } <strong 
class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> 
(WSConstants.WSS_ENC_KEY_VALUE_TYPE.equals(customValueType)) {
+<a name="257" href="#257">257</a>                     
secRef.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
+<a name="258" href="#258">258</a>                     
ref.setValueType(customValueType);
+<a name="259" href="#259">259</a>                 } <strong 
class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> 
(!WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE.equals(customValueType)) {
+<a name="260" href="#260">260</a>                     
secRef.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
+<a name="261" href="#261">261</a>                 }
+<a name="262" href="#262">262</a> 
+<a name="263" href="#263">263</a>                 secRef.setReference(ref);
+<a name="264" href="#264">264</a>             }
+<a name="265" href="#265">265</a>             
+<a name="266" href="#266">266</a>             
dkt.setSecurityTokenReference(secRef); 
+<a name="267" href="#267">267</a>         } <strong 
class="jxr_keyword">else</strong> {
+<a name="268" href="#268">268</a>             
dkt.setSecurityTokenReference(strElem);
+<a name="269" href="#269">269</a>         }
+<a name="270" href="#270">270</a>     }
+<a name="271" href="#271">271</a> 
+<a name="272" href="#272">272</a> 
+<a name="273" href="#273">273</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="274" href="#274">274</a> <em class="jxr_javadoccomment">     * 
Prepend the DerivedKey element to the elements already in the Security</em>
+<a name="275" href="#275">275</a> <em class="jxr_javadoccomment">     * 
header.</em>
+<a name="276" href="#276">276</a> <em class="jxr_javadoccomment">     * </em>
+<a name="277" href="#277">277</a> <em class="jxr_javadoccomment">     * The 
method can be called any time after &lt;code&gt;prepare()&lt;/code&gt;. 
This</em>
+<a name="278" href="#278">278</a> <em class="jxr_javadoccomment">     * allows 
to insert the DerivedKey element at any position in the Security</em>
+<a name="279" href="#279">279</a> <em class="jxr_javadoccomment">     * 
header.</em>
+<a name="280" href="#280">280</a> <em class="jxr_javadoccomment">     * </em>
+<a name="281" href="#281">281</a> <em class="jxr_javadoccomment">     * @param 
secHeader The security header that holds the Signature element.</em>
+<a name="282" href="#282">282</a> <em class="jxr_javadoccomment">     */</em>
+<a name="283" href="#283">283</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
prependDKElementToHeader(<a 
href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a>
 secHeader) {
+<a name="284" href="#284">284</a>         WSSecurityUtil.prependChildElement(
+<a name="285" href="#285">285</a>             secHeader.getSecurityHeader(), 
dkt.getElement()
+<a name="286" href="#286">286</a>         );
+<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">public</strong> <strong class="jxr_keyword">void</strong> 
appendDKElementToHeader(<a 
href="../../../../../org/apache/ws/security/message/WSSecHeader.html">WSSecHeader</a>
 secHeader) {
+<a name="290" href="#290">290</a>         Element secHeaderElement = 
secHeader.getSecurityHeader();
+<a name="291" href="#291">291</a>         
secHeaderElement.appendChild(dkt.getElement());
+<a name="292" href="#292">292</a>     }
+<a name="293" href="#293">293</a> 
+<a name="294" href="#294">294</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="295" href="#295">295</a> <em class="jxr_javadoccomment">     * @param 
wscVersion The wscVersion to set.</em>
+<a name="296" href="#296">296</a> <em class="jxr_javadoccomment">     */</em>
+<a name="297" href="#297">297</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
setWscVersion(<strong class="jxr_keyword">int</strong> wscVersion) {
+<a name="298" href="#298">298</a>         <strong 
class="jxr_keyword">this</strong>.wscVersion = wscVersion;
+<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">public</strong> Element getdktElement() {
+<a name="302" href="#302">302</a>         <strong 
class="jxr_keyword">return</strong> dkt.getElement();
+<a name="303" href="#303">303</a>     }
+<a name="304" href="#304">304</a> 
+<a name="305" href="#305">305</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
setDerivedKeyLength(<strong class="jxr_keyword">int</strong> keyLength) {
+<a name="306" href="#306">306</a>         derivedKeyLength = keyLength;
+<a name="307" href="#307">307</a>     }
+<a name="308" href="#308">308</a> 
+<a name="309" href="#309">309</a>     <strong 
class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
setCustomValueType(String customValueType) {
+<a name="310" href="#310">310</a>         <strong 
class="jxr_keyword">this</strong>.customValueType = customValueType;
+<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">public</strong> <strong class="jxr_keyword">void</strong> 
setTokenIdDirectId(<strong class="jxr_keyword">boolean</strong> b) {
+<a name="314" href="#314">314</a>         tokenIdDirectId = b;
+<a name="315" href="#315">315</a>     }
+<a name="316" href="#316">316</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a 
href="http://maven.apache.org/";>Maven</a></div></body>
 </html>


Reply via email to