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/07/28 15:24:03 UTC
svn commit: r798514 [42/44] - 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/transform/STRTransform.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/transform/STRTransform.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/transform/STRTransform.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/transform/STRTransform.html Tue Jul 28 13:23:48 2009
@@ -248,99 +248,100 @@
<a name="238" href="#238">238</a> }
<a name="239" href="#239">239</a> <em class="jxr_comment">// End of HACK</em>
<a name="240" href="#240">240</a> <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="241" href="#241">241</a> <strong class="jxr_keyword">throw</strong> (<strong class="jxr_keyword">new</strong> CanonicalizationException(<span class="jxr_string">"WS Security Exception"</span>, ex));
-<a name="242" href="#242">242</a> }
-<a name="243" href="#243">243</a> }
-<a name="244" href="#244">244</a>
-<a name="245" href="#245">245</a> <strong class="jxr_keyword">private</strong> Element dereferenceSTR(Document doc, <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef)
-<a name="246" href="#246">246</a> <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="247" href="#247">247</a> <em class="jxr_comment">//</em>
-<a name="248" href="#248">248</a> <em class="jxr_comment">// Third step: locate the security token referenced by the STR element.</em>
-<a name="249" href="#249">249</a> <em class="jxr_comment">// Either the Token is contained in the document as a</em>
-<a name="250" href="#250">250</a> <em class="jxr_comment">// BinarySecurityToken or stored in some key storage.</em>
-<a name="251" href="#251">251</a> <em class="jxr_comment">// </em>
-<a name="252" href="#252">252</a> <em class="jxr_comment">// Fourth step: after security token was located, prepare it. If its</em>
-<a name="253" href="#253">253</a> <em class="jxr_comment">// reference via a direct reference, i.e. a relative URI that references</em>
-<a name="254" href="#254">254</a> <em class="jxr_comment">// the BST directly in the message then just return that element.</em>
-<a name="255" href="#255">255</a> <em class="jxr_comment">// Otherwise wrap the located token in a newly created BST element as</em>
-<a name="256" href="#256">256</a> <em class="jxr_comment">// described in WSS Specification.</em>
-<a name="257" href="#257">257</a> <em class="jxr_comment">// </em>
-<a name="258" href="#258">258</a> <em class="jxr_comment">//</em>
-<a name="259" href="#259">259</a> Element tokElement = <strong class="jxr_keyword">null</strong>;
-<a name="260" href="#260">260</a>
-<a name="261" href="#261">261</a> <em class="jxr_comment">//</em>
-<a name="262" href="#262">262</a> <em class="jxr_comment">// First case: direct reference, according to chap 7.2 of OASIS WS</em>
-<a name="263" href="#263">263</a> <em class="jxr_comment">// specification (main document). Only in this case return a true</em>
-<a name="264" href="#264">264</a> <em class="jxr_comment">// reference to the BST. Copying is done by the caller.</em>
-<a name="265" href="#265">265</a> <em class="jxr_comment">//</em>
-<a name="266" href="#266">266</a> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
-<a name="267" href="#267">267</a> <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="268" href="#268">268</a> log.debug(<span class="jxr_string">"STR: Reference"</span>);
-<a name="269" href="#269">269</a> }
-<a name="270" href="#270">270</a> tokElement = secRef.getTokenElement(doc, wsDocInfo, <strong class="jxr_keyword">null</strong>);
-<a name="271" href="#271">271</a> }
-<a name="272" href="#272">272</a> <em class="jxr_comment">//</em>
-<a name="273" href="#273">273</a> <em class="jxr_comment">// second case: IssuerSerial, lookup in keystore, wrap in BST according</em>
-<a name="274" href="#274">274</a> <em class="jxr_comment">// to specification</em>
-<a name="275" href="#275">275</a> <em class="jxr_comment">//</em>
-<a name="276" href="#276">276</a> <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {
-<a name="277" href="#277">277</a> <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="278" href="#278">278</a> log.debug(<span class="jxr_string">"STR: IssuerSerial"</span>);
-<a name="279" href="#279">279</a> }
-<a name="280" href="#280">280</a> X509Certificate cert = <strong class="jxr_keyword">null</strong>;
-<a name="281" href="#281">281</a> X509Certificate[] certs =
-<a name="282" href="#282">282</a> secRef.getX509IssuerSerial(wsDocInfo.getCrypto());
-<a name="283" href="#283">283</a> <strong class="jxr_keyword">if</strong> (certs == <strong class="jxr_keyword">null</strong> || certs.length == 0 || certs[0] == <strong class="jxr_keyword">null</strong>) {
-<a name="284" href="#284">284</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_CHECK);
-<a name="285" href="#285">285</a> }
-<a name="286" href="#286">286</a> cert = certs[0];
-<a name="287" href="#287">287</a> tokElement = createBSTX509(doc, cert, secRef.getElement());
-<a name="288" href="#288">288</a> }
-<a name="289" href="#289">289</a> <em class="jxr_comment">//</em>
-<a name="290" href="#290">290</a> <em class="jxr_comment">// third case: KeyIdentifier. For SKI, lookup in keystore, wrap in</em>
-<a name="291" href="#291">291</a> <em class="jxr_comment">// BST according to specification. Otherwise if it's a wsse:KeyIdentifier it could</em>
-<a name="292" href="#292">292</a> <em class="jxr_comment">// be a SAML assertion, so try and find the referenced element.</em>
-<a name="293" href="#293">293</a> <em class="jxr_comment">//</em>
-<a name="294" href="#294">294</a> <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
-<a name="295" href="#295">295</a> <strong class="jxr_keyword">if</strong> (doDebug) {
-<a name="296" href="#296">296</a> log.debug(<span class="jxr_string">"STR: KeyIdentifier"</span>);
-<a name="297" href="#297">297</a> }
-<a name="298" href="#298">298</a> <strong class="jxr_keyword">if</strong> (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) {
-<a name="299" href="#299">299</a> tokElement = secRef.getKeyIdentifierTokenElement(doc, wsDocInfo, <strong class="jxr_keyword">null</strong>);
-<a name="300" href="#300">300</a> } <strong class="jxr_keyword">else</strong> {
-<a name="301" href="#301">301</a> X509Certificate cert = <strong class="jxr_keyword">null</strong>;
-<a name="302" href="#302">302</a> X509Certificate[] certs = secRef.getKeyIdentifier(wsDocInfo.getCrypto());
-<a name="303" href="#303">303</a> <strong class="jxr_keyword">if</strong> (certs == <strong class="jxr_keyword">null</strong> || certs.length == 0 || certs[0] == <strong class="jxr_keyword">null</strong>) {
-<a name="304" href="#304">304</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_CHECK);
-<a name="305" href="#305">305</a> }
-<a name="306" href="#306">306</a> cert = certs[0];
-<a name="307" href="#307">307</a> tokElement = createBSTX509(doc, cert, secRef.getElement());
-<a name="308" href="#308">308</a> }
-<a name="309" href="#309">309</a> }
-<a name="310" href="#310">310</a> <strong class="jxr_keyword">return</strong> tokElement;
-<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">private</strong> Element createBSTX509(Document doc, X509Certificate cert, Element secRefE)
-<a name="314" href="#314">314</a> <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="315" href="#315">315</a> byte data[];
-<a name="316" href="#316">316</a> <strong class="jxr_keyword">try</strong> {
-<a name="317" href="#317">317</a> data = cert.getEncoded();
-<a name="318" href="#318">318</a> } <strong class="jxr_keyword">catch</strong> (CertificateEncodingException e) {
-<a name="319" href="#319">319</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="320" href="#320">320</a> WSSecurityException.SECURITY_TOKEN_UNAVAILABLE, <span class="jxr_string">"encodeError"</span>, <strong class="jxr_keyword">null</strong>, e
-<a name="321" href="#321">321</a> );
-<a name="322" href="#322">322</a> }
-<a name="323" href="#323">323</a> String prefix = WSSecurityUtil.getPrefixNS(WSConstants.WSSE_NS, secRefE);
-<a name="324" href="#324">324</a> Element elem = doc.createElementNS(WSConstants.WSSE_NS, prefix + <span class="jxr_string">":BinarySecurityToken"</span>);
-<a name="325" href="#325">325</a> WSSecurityUtil.setNamespace(elem, WSConstants.WSSE_NS, prefix);
-<a name="326" href="#326">326</a> <em class="jxr_comment">// elem.setAttributeNS(WSConstants.XMLNS_NS, "xmlns", "");</em>
-<a name="327" href="#327">327</a> elem.setAttributeNS(<strong class="jxr_keyword">null</strong>, <span class="jxr_string">"ValueType"</span>, X509Security.X509_V3_TYPE);
-<a name="328" href="#328">328</a> Text certText = doc.createTextNode(Base64.encode(data)); <em class="jxr_comment">// no line wrap</em>
-<a name="329" href="#329">329</a> elem.appendChild(certText);
-<a name="330" href="#330">330</a> <strong class="jxr_keyword">return</strong> elem;
-<a name="331" href="#331">331</a> }
-<a name="332" href="#332">332</a>
-<a name="333" href="#333">333</a> }
+<a name="241" href="#241">241</a> log.debug(ex.getMessage(), ex);
+<a name="242" href="#242">242</a> <strong class="jxr_keyword">throw</strong> (<strong class="jxr_keyword">new</strong> CanonicalizationException(<span class="jxr_string">"c14n.Canonicalizer.Exception"</span>, ex));
+<a name="243" href="#243">243</a> }
+<a name="244" href="#244">244</a> }
+<a name="245" href="#245">245</a>
+<a name="246" href="#246">246</a> <strong class="jxr_keyword">private</strong> Element dereferenceSTR(Document doc, <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef)
+<a name="247" href="#247">247</a> <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="248" href="#248">248</a> <em class="jxr_comment">//</em>
+<a name="249" href="#249">249</a> <em class="jxr_comment">// Third step: locate the security token referenced by the STR element.</em>
+<a name="250" href="#250">250</a> <em class="jxr_comment">// Either the Token is contained in the document as a</em>
+<a name="251" href="#251">251</a> <em class="jxr_comment">// BinarySecurityToken or stored in some key storage.</em>
+<a name="252" href="#252">252</a> <em class="jxr_comment">// </em>
+<a name="253" href="#253">253</a> <em class="jxr_comment">// Fourth step: after security token was located, prepare it. If its</em>
+<a name="254" href="#254">254</a> <em class="jxr_comment">// reference via a direct reference, i.e. a relative URI that references</em>
+<a name="255" href="#255">255</a> <em class="jxr_comment">// the BST directly in the message then just return that element.</em>
+<a name="256" href="#256">256</a> <em class="jxr_comment">// Otherwise wrap the located token in a newly created BST element as</em>
+<a name="257" href="#257">257</a> <em class="jxr_comment">// described in WSS Specification.</em>
+<a name="258" href="#258">258</a> <em class="jxr_comment">// </em>
+<a name="259" href="#259">259</a> <em class="jxr_comment">//</em>
+<a name="260" href="#260">260</a> Element tokElement = <strong class="jxr_keyword">null</strong>;
+<a name="261" href="#261">261</a>
+<a name="262" href="#262">262</a> <em class="jxr_comment">//</em>
+<a name="263" href="#263">263</a> <em class="jxr_comment">// First case: direct reference, according to chap 7.2 of OASIS WS</em>
+<a name="264" href="#264">264</a> <em class="jxr_comment">// specification (main document). Only in this case return a true</em>
+<a name="265" href="#265">265</a> <em class="jxr_comment">// reference to the BST. Copying is done by the caller.</em>
+<a name="266" href="#266">266</a> <em class="jxr_comment">//</em>
+<a name="267" href="#267">267</a> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
+<a name="268" href="#268">268</a> <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="269" href="#269">269</a> log.debug(<span class="jxr_string">"STR: Reference"</span>);
+<a name="270" href="#270">270</a> }
+<a name="271" href="#271">271</a> tokElement = secRef.getTokenElement(doc, wsDocInfo, <strong class="jxr_keyword">null</strong>);
+<a name="272" href="#272">272</a> }
+<a name="273" href="#273">273</a> <em class="jxr_comment">//</em>
+<a name="274" href="#274">274</a> <em class="jxr_comment">// second case: IssuerSerial, lookup in keystore, wrap in BST according</em>
+<a name="275" href="#275">275</a> <em class="jxr_comment">// to specification</em>
+<a name="276" href="#276">276</a> <em class="jxr_comment">//</em>
+<a name="277" href="#277">277</a> <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {
+<a name="278" href="#278">278</a> <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="279" href="#279">279</a> log.debug(<span class="jxr_string">"STR: IssuerSerial"</span>);
+<a name="280" href="#280">280</a> }
+<a name="281" href="#281">281</a> X509Certificate cert = <strong class="jxr_keyword">null</strong>;
+<a name="282" href="#282">282</a> X509Certificate[] certs =
+<a name="283" href="#283">283</a> secRef.getX509IssuerSerial(wsDocInfo.getCrypto());
+<a name="284" href="#284">284</a> <strong class="jxr_keyword">if</strong> (certs == <strong class="jxr_keyword">null</strong> || certs.length == 0 || certs[0] == <strong class="jxr_keyword">null</strong>) {
+<a name="285" href="#285">285</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_CHECK);
+<a name="286" href="#286">286</a> }
+<a name="287" href="#287">287</a> cert = certs[0];
+<a name="288" href="#288">288</a> tokElement = createBSTX509(doc, cert, secRef.getElement());
+<a name="289" href="#289">289</a> }
+<a name="290" href="#290">290</a> <em class="jxr_comment">//</em>
+<a name="291" href="#291">291</a> <em class="jxr_comment">// third case: KeyIdentifier. For SKI, lookup in keystore, wrap in</em>
+<a name="292" href="#292">292</a> <em class="jxr_comment">// BST according to specification. Otherwise if it's a wsse:KeyIdentifier it could</em>
+<a name="293" href="#293">293</a> <em class="jxr_comment">// be a SAML assertion, so try and find the referenced element.</em>
+<a name="294" href="#294">294</a> <em class="jxr_comment">//</em>
+<a name="295" href="#295">295</a> <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
+<a name="296" href="#296">296</a> <strong class="jxr_keyword">if</strong> (doDebug) {
+<a name="297" href="#297">297</a> log.debug(<span class="jxr_string">"STR: KeyIdentifier"</span>);
+<a name="298" href="#298">298</a> }
+<a name="299" href="#299">299</a> <strong class="jxr_keyword">if</strong> (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) {
+<a name="300" href="#300">300</a> tokElement = secRef.getKeyIdentifierTokenElement(doc, wsDocInfo, <strong class="jxr_keyword">null</strong>);
+<a name="301" href="#301">301</a> } <strong class="jxr_keyword">else</strong> {
+<a name="302" href="#302">302</a> X509Certificate cert = <strong class="jxr_keyword">null</strong>;
+<a name="303" href="#303">303</a> X509Certificate[] certs = secRef.getKeyIdentifier(wsDocInfo.getCrypto());
+<a name="304" href="#304">304</a> <strong class="jxr_keyword">if</strong> (certs == <strong class="jxr_keyword">null</strong> || certs.length == 0 || certs[0] == <strong class="jxr_keyword">null</strong>) {
+<a name="305" href="#305">305</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_CHECK);
+<a name="306" href="#306">306</a> }
+<a name="307" href="#307">307</a> cert = certs[0];
+<a name="308" href="#308">308</a> tokElement = createBSTX509(doc, cert, secRef.getElement());
+<a name="309" href="#309">309</a> }
+<a name="310" href="#310">310</a> }
+<a name="311" href="#311">311</a> <strong class="jxr_keyword">return</strong> tokElement;
+<a name="312" href="#312">312</a> }
+<a name="313" href="#313">313</a>
+<a name="314" href="#314">314</a> <strong class="jxr_keyword">private</strong> Element createBSTX509(Document doc, X509Certificate cert, Element secRefE)
+<a name="315" href="#315">315</a> <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="316" href="#316">316</a> byte data[];
+<a name="317" href="#317">317</a> <strong class="jxr_keyword">try</strong> {
+<a name="318" href="#318">318</a> data = cert.getEncoded();
+<a name="319" href="#319">319</a> } <strong class="jxr_keyword">catch</strong> (CertificateEncodingException e) {
+<a name="320" href="#320">320</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="321" href="#321">321</a> WSSecurityException.SECURITY_TOKEN_UNAVAILABLE, <span class="jxr_string">"encodeError"</span>, <strong class="jxr_keyword">null</strong>, e
+<a name="322" href="#322">322</a> );
+<a name="323" href="#323">323</a> }
+<a name="324" href="#324">324</a> String prefix = WSSecurityUtil.getPrefixNS(WSConstants.WSSE_NS, secRefE);
+<a name="325" href="#325">325</a> Element elem = doc.createElementNS(WSConstants.WSSE_NS, prefix + <span class="jxr_string">":BinarySecurityToken"</span>);
+<a name="326" href="#326">326</a> WSSecurityUtil.setNamespace(elem, WSConstants.WSSE_NS, prefix);
+<a name="327" href="#327">327</a> <em class="jxr_comment">// elem.setAttributeNS(WSConstants.XMLNS_NS, "xmlns", "");</em>
+<a name="328" href="#328">328</a> elem.setAttributeNS(<strong class="jxr_keyword">null</strong>, <span class="jxr_string">"ValueType"</span>, X509Security.X509_V3_TYPE);
+<a name="329" href="#329">329</a> Text certText = doc.createTextNode(Base64.encode(data)); <em class="jxr_comment">// no line wrap</em>
+<a name="330" href="#330">330</a> elem.appendChild(certText);
+<a name="331" href="#331">331</a> <strong class="jxr_keyword">return</strong> elem;
+<a name="332" href="#332">332</a> }
+<a name="333" href="#333">333</a>
+<a name="334" href="#334">334</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/transform/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/transform/package-frame.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/transform/package-frame.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/transform/package-frame.html Tue Jul 28 13:23:48 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.7 Reference Package org.apache.ws.security.transform</title>
+ <title>WSS4J 1.5.8 Reference Package org.apache.ws.security.transform</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
</head>
<body>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/transform/package-summary.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/transform/package-summary.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/transform/package-summary.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/transform/package-summary.html Tue Jul 28 13:23:48 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.7 Reference Package org.apache.ws.security.transform</title>
+ <title>WSS4J 1.5.8 Reference Package org.apache.ws.security.transform</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