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 [24/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...

Added: webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS194.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS194.html?rev=798514&view=auto
==============================================================================
--- webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS194.html (added)
+++ webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS194.html Tue Jul 28 13:23:48 2009
@@ -0,0 +1,230 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<title>TestWSSecurityWSS194 xref</title>
+<link type="text/css" rel="stylesheet" href="../stylesheet.css" />
+</head>
+<body>
+<pre>
+
+<a name="1" href="#1">1</a>   <em class="jxr_javadoccomment">/**</em>
+<a name="2" href="#2">2</a>   <em class="jxr_javadoccomment"> * Licensed to the Apache Software Foundation (ASF) under one</em>
+<a name="3" href="#3">3</a>   <em class="jxr_javadoccomment"> * or more contributor license agreements. See the NOTICE file</em>
+<a name="4" href="#4">4</a>   <em class="jxr_javadoccomment"> * distributed with this work for additional information</em>
+<a name="5" href="#5">5</a>   <em class="jxr_javadoccomment"> * regarding copyright ownership. The ASF licenses this file</em>
+<a name="6" href="#6">6</a>   <em class="jxr_javadoccomment"> * to you under the Apache License, Version 2.0 (the</em>
+<a name="7" href="#7">7</a>   <em class="jxr_javadoccomment"> * "License"); you may not use this file except in compliance</em>
+<a name="8" href="#8">8</a>   <em class="jxr_javadoccomment"> * with the License. You may obtain a copy of the License at</em>
+<a name="9" href="#9">9</a>   <em class="jxr_javadoccomment"> *</em>
+<a name="10" href="#10">10</a>  <em class="jxr_javadoccomment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="11" href="#11">11</a>  <em class="jxr_javadoccomment"> *</em>
+<a name="12" href="#12">12</a>  <em class="jxr_javadoccomment"> * Unless required by applicable law or agreed to in writing,</em>
+<a name="13" href="#13">13</a>  <em class="jxr_javadoccomment"> * software distributed under the License is distributed on an</em>
+<a name="14" href="#14">14</a>  <em class="jxr_javadoccomment"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</em>
+<a name="15" href="#15">15</a>  <em class="jxr_javadoccomment"> * KIND, either express or implied. See the License for the</em>
+<a name="16" href="#16">16</a>  <em class="jxr_javadoccomment"> * specific language governing permissions and limitations</em>
+<a name="17" href="#17">17</a>  <em class="jxr_javadoccomment"> * under the License.</em>
+<a name="18" href="#18">18</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong class="jxr_keyword">package</strong> wssec;
+<a name="21" href="#21">21</a>  
+<a name="22" href="#22">22</a>  <strong class="jxr_keyword">import</strong> java.io.ByteArrayInputStream;
+<a name="23" href="#23">23</a>  <strong class="jxr_keyword">import</strong> java.io.IOException;
+<a name="24" href="#24">24</a>  <strong class="jxr_keyword">import</strong> java.io.InputStream;
+<a name="25" href="#25">25</a>  <strong class="jxr_keyword">import</strong> java.util.Vector;
+<a name="26" href="#26">26</a>  
+<a name="27" href="#27">27</a>  <strong class="jxr_keyword">import</strong> javax.security.auth.callback.Callback;
+<a name="28" href="#28">28</a>  <strong class="jxr_keyword">import</strong> javax.security.auth.callback.CallbackHandler;
+<a name="29" href="#29">29</a>  <strong class="jxr_keyword">import</strong> javax.security.auth.callback.UnsupportedCallbackException;
+<a name="30" href="#30">30</a>  
+<a name="31" href="#31">31</a>  <strong class="jxr_keyword">import</strong> junit.framework.Test;
+<a name="32" href="#32">32</a>  <strong class="jxr_keyword">import</strong> junit.framework.TestCase;
+<a name="33" href="#33">33</a>  <strong class="jxr_keyword">import</strong> junit.framework.TestSuite;
+<a name="34" href="#34">34</a>  
+<a name="35" href="#35">35</a>  <strong class="jxr_keyword">import</strong> org.apache.axis.Message;
+<a name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong> org.apache.axis.MessageContext;
+<a name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong> org.apache.axis.client.AxisClient;
+<a name="38" href="#38">38</a>  <strong class="jxr_keyword">import</strong> org.apache.axis.configuration.NullProvider;
+<a name="39" href="#39">39</a>  <strong class="jxr_keyword">import</strong> org.apache.axis.message.SOAPEnvelope;
+<a name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.logging.Log;
+<a name="41" href="#41">41</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.logging.LogFactory;
+<a name="42" href="#42">42</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSConstants;
+<a name="43" href="#43">43</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSPasswordCallback;
+<a name="44" href="#44">44</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSSConfig;
+<a name="45" href="#45">45</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSSecurityEngine;
+<a name="46" href="#46">46</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.components.crypto.CryptoFactory;
+<a name="47" href="#47">47</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.handler.RequestData;
+<a name="48" href="#48">48</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.handler.WSHandlerConstants;
+<a name="49" href="#49">49</a>  <strong class="jxr_keyword">import</strong> org.w3c.dom.Document;
+<a name="50" href="#50">50</a>  
+<a name="51" href="#51">51</a>  
+<a name="52" href="#52">52</a>  <em class="jxr_javadoccomment">/**</em>
+<a name="53" href="#53">53</a>  <em class="jxr_javadoccomment"> * This is a test for WSS-194 - "Support overriding KeyStore alias for signature so that it can</em>
+<a name="54" href="#54">54</a>  <em class="jxr_javadoccomment"> * be different than user name used for UsernameToken".</em>
+<a name="55" href="#55">55</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="56" href="#56">56</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> TestWSSecurityWSS194 <strong class="jxr_keyword">extends</strong> TestCase implements CallbackHandler {
+<a name="57" href="#57">57</a>      
+<a name="58" href="#58">58</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> Log LOG = LogFactory.getLog(TestWSSecurityWSS194.<strong class="jxr_keyword">class</strong>);
+<a name="59" href="#59">59</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> String SOAPMSG = 
+<a name="60" href="#60">60</a>          <span class="jxr_string">"&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;"</span> 
+<a name="61" href="#61">61</a>          + <span class="jxr_string">"&lt;SOAP-ENV:Envelope "</span>
+<a name="62" href="#62">62</a>          +   <span class="jxr_string">"xmlns:SOAP-ENV=\&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot; "</span>
+<a name="63" href="#63">63</a>          +   <span class="jxr_string">"xmlns:xsd=\&quot;http://www.w3.org/2001/XMLSchema\&quot; "</span>
+<a name="64" href="#64">64</a>          +   <span class="jxr_string">"xmlns:xsi=\&quot;http://www.w3.org/2001/XMLSchema-instance\&quot;&gt;"</span> 
+<a name="65" href="#65">65</a>          +   <span class="jxr_string">"&lt;SOAP-ENV:Body&gt;"</span> 
+<a name="66" href="#66">66</a>          +       <span class="jxr_string">"&lt;add xmlns=\&quot;http://ws.apache.org/counter/counter_port_type\&quot;&gt;"</span> 
+<a name="67" href="#67">67</a>          +           <span class="jxr_string">"&lt;value xmlns=\&quot;\&quot;&gt;15&lt;/value&gt;"</span> 
+<a name="68" href="#68">68</a>          +       <span class="jxr_string">"&lt;/add&gt;"</span> 
+<a name="69" href="#69">69</a>          +   <span class="jxr_string">"&lt;/SOAP-ENV:Body&gt;"</span> 
+<a name="70" href="#70">70</a>          + <span class="jxr_string">"&lt;/SOAP-ENV:Envelope&gt;"</span>;
+<a name="71" href="#71">71</a>      <strong class="jxr_keyword">private</strong> WSSecurityEngine secEngine = <strong class="jxr_keyword">new</strong> WSSecurityEngine();
+<a name="72" href="#72">72</a>      <strong class="jxr_keyword">private</strong> MessageContext msgContext;
+<a name="73" href="#73">73</a>      <strong class="jxr_keyword">private</strong> SOAPEnvelope unsignedEnvelope;
+<a name="74" href="#74">74</a>  
+<a name="75" href="#75">75</a>      <em class="jxr_javadoccomment">/**</em>
+<a name="76" href="#76">76</a>  <em class="jxr_javadoccomment">     * TestWSSecurity constructor</em>
+<a name="77" href="#77">77</a>  <em class="jxr_javadoccomment">     * &lt;p/&gt;</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 name name of the test</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> TestWSSecurityWSS194(String name) {
+<a name="82" href="#82">82</a>          <strong class="jxr_keyword">super</strong>(name);
+<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">     * JUnit suite</em>
+<a name="87" href="#87">87</a>  <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
+<a name="88" href="#88">88</a>  <em class="jxr_javadoccomment">     * </em>
+<a name="89" href="#89">89</a>  <em class="jxr_javadoccomment">     * @return a junit test suite</em>
+<a name="90" href="#90">90</a>  <em class="jxr_javadoccomment">     */</em>
+<a name="91" href="#91">91</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> Test suite() {
+<a name="92" href="#92">92</a>          <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> TestSuite(TestWSSecurityWSS194.<strong class="jxr_keyword">class</strong>);
+<a name="93" href="#93">93</a>      }
+<a name="94" href="#94">94</a>  
+<a name="95" href="#95">95</a>      <em class="jxr_javadoccomment">/**</em>
+<a name="96" href="#96">96</a>  <em class="jxr_javadoccomment">     * Setup method</em>
+<a name="97" href="#97">97</a>  <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
+<a name="98" href="#98">98</a>  <em class="jxr_javadoccomment">     * </em>
+<a name="99" href="#99">99</a>  <em class="jxr_javadoccomment">     * @throws java.lang.Exception Thrown when there is a problem in setup</em>
+<a name="100" href="#100">100</a> <em class="jxr_javadoccomment">     */</em>
+<a name="101" href="#101">101</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> setUp() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="102" href="#102">102</a>         AxisClient tmpEngine = <strong class="jxr_keyword">new</strong> AxisClient(<strong class="jxr_keyword">new</strong> NullProvider());
+<a name="103" href="#103">103</a>         msgContext = <strong class="jxr_keyword">new</strong> MessageContext(tmpEngine);
+<a name="104" href="#104">104</a>         unsignedEnvelope = getSOAPEnvelope();
+<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">     * Constructs a soap envelope</em>
+<a name="109" href="#109">109</a> <em class="jxr_javadoccomment">     * &lt;p/&gt;</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 soap envelope</em>
+<a name="112" href="#112">112</a> <em class="jxr_javadoccomment">     * @throws java.lang.Exception if there is any problem constructing the soap envelope</em>
+<a name="113" href="#113">113</a> <em class="jxr_javadoccomment">     */</em>
+<a name="114" href="#114">114</a>     <strong class="jxr_keyword">protected</strong> SOAPEnvelope getSOAPEnvelope() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="115" href="#115">115</a>         InputStream in = <strong class="jxr_keyword">new</strong> ByteArrayInputStream(SOAPMSG.getBytes());
+<a name="116" href="#116">116</a>         Message msg = <strong class="jxr_keyword">new</strong> Message(in);
+<a name="117" href="#117">117</a>         msg.setMessageContext(msgContext);
+<a name="118" href="#118">118</a>         <strong class="jxr_keyword">return</strong> msg.getSOAPEnvelope();
+<a name="119" href="#119">119</a>     }
+<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">     * Test involving adding a Username Token to a SOAP message and signing it, where the</em>
+<a name="124" href="#124">124</a> <em class="jxr_javadoccomment">     * private key for signature is extracted from the KeyStore using a different username/alias</em>
+<a name="125" href="#125">125</a> <em class="jxr_javadoccomment">     * to the UsernameToken. </em>
+<a name="126" href="#126">126</a> <em class="jxr_javadoccomment">     */</em>
+<a name="127" href="#127">127</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> 
+<a name="128" href="#128">128</a>     testUsernameTokenSignatureHandler() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="129" href="#129">129</a>         <strong class="jxr_keyword">final</strong> WSSConfig cfg = WSSConfig.getNewInstance();
+<a name="130" href="#130">130</a>         <strong class="jxr_keyword">final</strong> RequestData reqData = <strong class="jxr_keyword">new</strong> RequestData();
+<a name="131" href="#131">131</a>         reqData.setWssConfig(cfg);
+<a name="132" href="#132">132</a>         reqData.setUsername(<span class="jxr_string">"alice"</span>);
+<a name="133" href="#133">133</a>         reqData.setPwType(WSConstants.PASSWORD_DIGEST);
+<a name="134" href="#134">134</a>         java.util.Map messageContext = <strong class="jxr_keyword">new</strong> java.util.TreeMap();
+<a name="135" href="#135">135</a>         messageContext.put(
+<a name="136" href="#136">136</a>             WSHandlerConstants.PW_CALLBACK_REF, 
+<a name="137" href="#137">137</a>             <strong class="jxr_keyword">this</strong>
+<a name="138" href="#138">138</a>         );
+<a name="139" href="#139">139</a>         messageContext.put(WSHandlerConstants.SIGNATURE_USER, <span class="jxr_string">"wss86"</span>);
+<a name="140" href="#140">140</a>         messageContext.put(WSHandlerConstants.SIG_PROP_FILE, <span class="jxr_string">"wss86.properties"</span>);
+<a name="141" href="#141">141</a>         messageContext.put(
+<a name="142" href="#142">142</a>             WSHandlerConstants.SIGNATURE_PARTS, 
+<a name="143" href="#143">143</a>             <span class="jxr_string">"{}{"</span> + WSConstants.WSSE_NS + <span class="jxr_string">"}"</span> + <span class="jxr_string">"UsernameToken"</span>
+<a name="144" href="#144">144</a>         );
+<a name="145" href="#145">145</a>         messageContext.put(WSHandlerConstants.SIG_KEY_ID, <span class="jxr_string">"DirectReference"</span>);
+<a name="146" href="#146">146</a>         reqData.setMsgContext(messageContext);
+<a name="147" href="#147">147</a>         
+<a name="148" href="#148">148</a>         <strong class="jxr_keyword">final</strong> java.util.Vector actions = <strong class="jxr_keyword">new</strong> java.util.Vector();
+<a name="149" href="#149">149</a>         actions.add(<strong class="jxr_keyword">new</strong> Integer(WSConstants.UT));
+<a name="150" href="#150">150</a>         actions.add(<strong class="jxr_keyword">new</strong> Integer(WSConstants.SIGN));
+<a name="151" href="#151">151</a>         <strong class="jxr_keyword">final</strong> Document doc = unsignedEnvelope.getAsDocument();
+<a name="152" href="#152">152</a>         <a href="../wssec/TestWSSecurityResultsOrder.html">MyHandler</a> handler = <strong class="jxr_keyword">new</strong> <a href="../wssec/TestWSSecurityResultsOrder.html">MyHandler</a>();
+<a name="153" href="#153">153</a>         handler.send(
+<a name="154" href="#154">154</a>             WSConstants.UT | WSConstants.SIGN, 
+<a name="155" href="#155">155</a>             doc, 
+<a name="156" href="#156">156</a>             reqData, 
+<a name="157" href="#157">157</a>             actions,
+<a name="158" href="#158">158</a>             <strong class="jxr_keyword">true</strong>
+<a name="159" href="#159">159</a>         );
+<a name="160" href="#160">160</a>         
+<a name="161" href="#161">161</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="162" href="#162">162</a>             LOG.debug(<span class="jxr_string">"After Signing...."</span>);
+<a name="163" href="#163">163</a>             String outputString = 
+<a name="164" href="#164">164</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
+<a name="165" href="#165">165</a>             LOG.debug(outputString);
+<a name="166" href="#166">166</a>         }
+<a name="167" href="#167">167</a>         
+<a name="168" href="#168">168</a>         verify(doc);
+<a name="169" href="#169">169</a>         
+<a name="170" href="#170">170</a>     }
+<a name="171" href="#171">171</a>     
+<a name="172" href="#172">172</a> 
+<a name="173" href="#173">173</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="174" href="#174">174</a> <em class="jxr_javadoccomment">     * Verifies the soap envelope</em>
+<a name="175" href="#175">175</a> <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
+<a name="176" href="#176">176</a> <em class="jxr_javadoccomment">     * </em>
+<a name="177" href="#177">177</a> <em class="jxr_javadoccomment">     * @param doc </em>
+<a name="178" href="#178">178</a> <em class="jxr_javadoccomment">     * @throws Exception Thrown when there is a problem in verification</em>
+<a name="179" href="#179">179</a> <em class="jxr_javadoccomment">     */</em>
+<a name="180" href="#180">180</a>     <strong class="jxr_keyword">private</strong> Vector verify(Document doc) <strong class="jxr_keyword">throws</strong> Exception {
+<a name="181" href="#181">181</a>         Vector results = 
+<a name="182" href="#182">182</a>             secEngine.processSecurityHeader(
+<a name="183" href="#183">183</a>                 doc, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">this</strong>, CryptoFactory.getInstance(<span class="jxr_string">"wss86.properties"</span>)
+<a name="184" href="#184">184</a>             );
+<a name="185" href="#185">185</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="186" href="#186">186</a>             LOG.debug(<span class="jxr_string">"Verfied and decrypted message:"</span>);
+<a name="187" href="#187">187</a>             String outputString = 
+<a name="188" href="#188">188</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
+<a name="189" href="#189">189</a>             LOG.debug(outputString);
+<a name="190" href="#190">190</a>         }
+<a name="191" href="#191">191</a>         <strong class="jxr_keyword">return</strong> results;
+<a name="192" href="#192">192</a>     }
+<a name="193" href="#193">193</a> 
+<a name="194" href="#194">194</a>     
+<a name="195" href="#195">195</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> handle(Callback[] callbacks)
+<a name="196" href="#196">196</a>         <strong class="jxr_keyword">throws</strong> IOException, UnsupportedCallbackException {
+<a name="197" href="#197">197</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; callbacks.length; i++) {
+<a name="198" href="#198">198</a>             <strong class="jxr_keyword">if</strong> (callbacks[i] instanceof WSPasswordCallback) {
+<a name="199" href="#199">199</a>                 WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
+<a name="200" href="#200">200</a>                 <strong class="jxr_keyword">if</strong> (pc.getUsage() == WSPasswordCallback.USERNAME_TOKEN
+<a name="201" href="#201">201</a>                         &amp;&amp; <span class="jxr_string">"alice"</span>.equals(pc.getIdentifier())) {
+<a name="202" href="#202">202</a>                     pc.setPassword(<span class="jxr_string">"verySecret"</span>);
+<a name="203" href="#203">203</a>                 } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (pc.getUsage() == WSPasswordCallback.SIGNATURE
+<a name="204" href="#204">204</a>                         &amp;&amp; <span class="jxr_string">"wss86"</span>.equals(pc.getIdentifier())) {
+<a name="205" href="#205">205</a>                     pc.setPassword(<span class="jxr_string">"security"</span>);
+<a name="206" href="#206">206</a>                 } <strong class="jxr_keyword">else</strong> {
+<a name="207" href="#207">207</a>                     <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IOException(<span class="jxr_string">"Authentication failed"</span>);
+<a name="208" href="#208">208</a>                 }
+<a name="209" href="#209">209</a>             } <strong class="jxr_keyword">else</strong> {
+<a name="210" href="#210">210</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> UnsupportedCallbackException(callbacks[i], <span class="jxr_string">"Unrecognized Callback"</span>);
+<a name="211" href="#211">211</a>             }
+<a name="212" href="#212">212</a>         }
+<a name="213" href="#213">213</a>     }
+<a name="214" href="#214">214</a> 
+<a name="215" href="#215">215</a>     
+<a name="216" href="#216">216</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Added: webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS199.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS199.html?rev=798514&view=auto
==============================================================================
--- webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS199.html (added)
+++ webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS199.html Tue Jul 28 13:23:48 2009
@@ -0,0 +1,174 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<title>TestWSSecurityWSS199 xref</title>
+<link type="text/css" rel="stylesheet" href="../stylesheet.css" />
+</head>
+<body>
+<pre>
+
+<a name="1" href="#1">1</a>   <em class="jxr_javadoccomment">/**</em>
+<a name="2" href="#2">2</a>   <em class="jxr_javadoccomment"> * Licensed to the Apache Software Foundation (ASF) under one</em>
+<a name="3" href="#3">3</a>   <em class="jxr_javadoccomment"> * or more contributor license agreements. See the NOTICE file</em>
+<a name="4" href="#4">4</a>   <em class="jxr_javadoccomment"> * distributed with this work for additional information</em>
+<a name="5" href="#5">5</a>   <em class="jxr_javadoccomment"> * regarding copyright ownership. The ASF licenses this file</em>
+<a name="6" href="#6">6</a>   <em class="jxr_javadoccomment"> * to you under the Apache License, Version 2.0 (the</em>
+<a name="7" href="#7">7</a>   <em class="jxr_javadoccomment"> * "License"); you may not use this file except in compliance</em>
+<a name="8" href="#8">8</a>   <em class="jxr_javadoccomment"> * with the License. You may obtain a copy of the License at</em>
+<a name="9" href="#9">9</a>   <em class="jxr_javadoccomment"> *</em>
+<a name="10" href="#10">10</a>  <em class="jxr_javadoccomment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="11" href="#11">11</a>  <em class="jxr_javadoccomment"> *</em>
+<a name="12" href="#12">12</a>  <em class="jxr_javadoccomment"> * Unless required by applicable law or agreed to in writing,</em>
+<a name="13" href="#13">13</a>  <em class="jxr_javadoccomment"> * software distributed under the License is distributed on an</em>
+<a name="14" href="#14">14</a>  <em class="jxr_javadoccomment"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</em>
+<a name="15" href="#15">15</a>  <em class="jxr_javadoccomment"> * KIND, either express or implied. See the License for the</em>
+<a name="16" href="#16">16</a>  <em class="jxr_javadoccomment"> * specific language governing permissions and limitations</em>
+<a name="17" href="#17">17</a>  <em class="jxr_javadoccomment"> * under the License.</em>
+<a name="18" href="#18">18</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong class="jxr_keyword">package</strong> wssec;
+<a name="21" href="#21">21</a>  
+<a name="22" href="#22">22</a>  <strong class="jxr_keyword">import</strong> junit.framework.Test;
+<a name="23" href="#23">23</a>  <strong class="jxr_keyword">import</strong> junit.framework.TestCase;
+<a name="24" href="#24">24</a>  <strong class="jxr_keyword">import</strong> junit.framework.TestSuite;
+<a name="25" href="#25">25</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.logging.Log;
+<a name="26" href="#26">26</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.logging.LogFactory;
+<a name="27" href="#27">27</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSSecurityException;
+<a name="28" href="#28">28</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSPasswordCallback;
+<a name="29" href="#29">29</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSSecurityEngine;
+<a name="30" href="#30">30</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSConstants;
+<a name="31" href="#31">31</a>  <strong class="jxr_keyword">import</strong> org.apache.ws.security.WSSConfig;
+<a name="32" href="#32">32</a>  <strong class="jxr_keyword">import</strong> org.w3c.dom.Document;
+<a name="33" href="#33">33</a>  
+<a name="34" href="#34">34</a>  <strong class="jxr_keyword">import</strong> javax.security.auth.callback.Callback;
+<a name="35" href="#35">35</a>  <strong class="jxr_keyword">import</strong> javax.security.auth.callback.CallbackHandler;
+<a name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong> javax.security.auth.callback.UnsupportedCallbackException;
+<a name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong> java.io.IOException;
+<a name="38" href="#38">38</a>  
+<a name="39" href="#39">39</a>  
+<a name="40" href="#40">40</a>  <em class="jxr_javadoccomment">/**</em>
+<a name="41" href="#41">41</a>  <em class="jxr_javadoccomment"> * A test-case for WSS-199 - "Add support for WCF non-standard Username Tokens"</em>
+<a name="42" href="#42">42</a>  <em class="jxr_javadoccomment"> * (see also WSS-148 - "WCF interop issue: Namespace not honored incase of attributes.").</em>
+<a name="43" href="#43">43</a>  <em class="jxr_javadoccomment"> * The issue is that WCF generated Username Tokens where the password type is namespace</em>
+<a name="44" href="#44">44</a>  <em class="jxr_javadoccomment"> * qualified (incorrectly). WSS-199 added the ability to process these Username Tokens.</em>
+<a name="45" href="#45">45</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="46" href="#46">46</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> TestWSSecurityWSS199 <strong class="jxr_keyword">extends</strong> TestCase implements CallbackHandler {
+<a name="47" href="#47">47</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> Log LOG = LogFactory.getLog(TestWSSecurityWSS199.<strong class="jxr_keyword">class</strong>);
+<a name="48" href="#48">48</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> String SOAPUTMSG = 
+<a name="49" href="#49">49</a>          <span class="jxr_string">"&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;"</span> 
+<a name="50" href="#50">50</a>          + <span class="jxr_string">"&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=\&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot; "</span>
+<a name="51" href="#51">51</a>          + <span class="jxr_string">"xmlns:xsd=\&quot;http://www.w3.org/2001/XMLSchema\&quot; "</span>
+<a name="52" href="#52">52</a>          + <span class="jxr_string">"xmlns:xsi=\&quot;http://www.w3.org/2001/XMLSchema-instance\&quot;&gt;"</span>
+<a name="53" href="#53">53</a>          + <span class="jxr_string">"&lt;SOAP-ENV:Header&gt;"</span>
+<a name="54" href="#54">54</a>          + <span class="jxr_string">"&lt;wsse:Security SOAP-ENV:mustUnderstand=\&quot;1\&quot; "</span>
+<a name="55" href="#55">55</a>          + <span class="jxr_string">"xmlns:wsse=\&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\&quot;&gt;"</span>
+<a name="56" href="#56">56</a>          + <span class="jxr_string">"&lt;wsse:UsernameToken wsu:Id=\&quot;UsernameToken-29477163\&quot; xmlns:wsu=\&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\&quot;&gt;"</span>
+<a name="57" href="#57">57</a>          + <span class="jxr_string">"&lt;wsse:Username&gt;wernerd&lt;/wsse:Username&gt;"</span>
+<a name="58" href="#58">58</a>          + <span class="jxr_string">"&lt;wsse:Password "</span> 
+<a name="59" href="#59">59</a>          + <span class="jxr_string">"wsse:Type=\&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\&quot;&gt;verySecret&lt;/wsse:Password&gt;"</span>
+<a name="60" href="#60">60</a>          + <span class="jxr_string">"&lt;/wsse:UsernameToken&gt;&lt;/wsse:Security&gt;&lt;/SOAP-ENV:Header&gt;"</span>
+<a name="61" href="#61">61</a>          + <span class="jxr_string">"&lt;SOAP-ENV:Body&gt;"</span> 
+<a name="62" href="#62">62</a>          + <span class="jxr_string">"&lt;add xmlns=\&quot;http://ws.apache.org/counter/counter_port_type\&quot;&gt;"</span> 
+<a name="63" href="#63">63</a>          + <span class="jxr_string">"&lt;value xmlns=\&quot;\&quot;&gt;15&lt;/value&gt;"</span> + <span class="jxr_string">"&lt;/add&gt;"</span> 
+<a name="64" href="#64">64</a>          + <span class="jxr_string">"&lt;/SOAP-ENV:Body&gt;\r\n       \r\n"</span> + <span class="jxr_string">"&lt;/SOAP-ENV:Envelope&gt;"</span>;
+<a name="65" href="#65">65</a>      
+<a name="66" href="#66">66</a>      <strong class="jxr_keyword">private</strong> WSSecurityEngine secEngine = <strong class="jxr_keyword">new</strong> WSSecurityEngine();
+<a name="67" href="#67">67</a>  
+<a name="68" href="#68">68</a>      <em class="jxr_javadoccomment">/**</em>
+<a name="69" href="#69">69</a>  <em class="jxr_javadoccomment">     * TestWSSecurity constructor</em>
+<a name="70" href="#70">70</a>  <em class="jxr_javadoccomment">     * </em>
+<a name="71" href="#71">71</a>  <em class="jxr_javadoccomment">     * @param name name of the test</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> TestWSSecurityWSS199(String name) {
+<a name="74" href="#74">74</a>          <strong class="jxr_keyword">super</strong>(name);
+<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">     * JUnit suite</em>
+<a name="79" href="#79">79</a>  <em class="jxr_javadoccomment">     * </em>
+<a name="80" href="#80">80</a>  <em class="jxr_javadoccomment">     * @return a junit test suite</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">static</strong> Test suite() {
+<a name="83" href="#83">83</a>          <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> TestSuite(TestWSSecurityWSS199.<strong class="jxr_keyword">class</strong>);
+<a name="84" href="#84">84</a>      }
+<a name="85" href="#85">85</a>  
+<a name="86" href="#86">86</a>  
+<a name="87" href="#87">87</a>      <em class="jxr_javadoccomment">/**</em>
+<a name="88" href="#88">88</a>  <em class="jxr_javadoccomment">     * Test that adds a UserNameToken with a namespace qualified type. This should fail</em>
+<a name="89" href="#89">89</a>  <em class="jxr_javadoccomment">     * as WSS4J rejects these tokens by default.</em>
+<a name="90" href="#90">90</a>  <em class="jxr_javadoccomment">     */</em>
+<a name="91" href="#91">91</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testNamespaceQualifiedTypeRejected() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="92" href="#92">92</a>          Document doc = SOAPUtil.toSOAPPart(SOAPUTMSG);
+<a name="93" href="#93">93</a>  
+<a name="94" href="#94">94</a>          <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="95" href="#95">95</a>              LOG.debug(<span class="jxr_string">"Message with UserNameToken PW Digest:"</span>);
+<a name="96" href="#96">96</a>              String outputString = 
+<a name="97" href="#97">97</a>                  org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
+<a name="98" href="#98">98</a>              LOG.debug(outputString);
+<a name="99" href="#99">99</a>          }
+<a name="100" href="#100">100</a>         <strong class="jxr_keyword">try</strong> {
+<a name="101" href="#101">101</a>             verify(doc);
+<a name="102" href="#102">102</a>             fail(<span class="jxr_string">"Failure expected on a bad password type"</span>);
+<a name="103" href="#103">103</a>         } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="104" href="#104">104</a>             <em class="jxr_comment">// expected</em>
+<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>     
+<a name="109" href="#109">109</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="110" href="#110">110</a> <em class="jxr_javadoccomment">     * Test that adds a UserNameToken with a namespace qualified type. This should pass</em>
+<a name="111" href="#111">111</a> <em class="jxr_javadoccomment">     * as WSS4J has been configured to accept these tokens.</em>
+<a name="112" href="#112">112</a> <em class="jxr_javadoccomment">     */</em>
+<a name="113" href="#113">113</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testNamespaceQualifiedTypeAccepted() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="114" href="#114">114</a>         Document doc = SOAPUtil.toSOAPPart(SOAPUTMSG);
+<a name="115" href="#115">115</a> 
+<a name="116" href="#116">116</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="117" href="#117">117</a>             LOG.debug(<span class="jxr_string">"Message with UserNameToken PW Digest:"</span>);
+<a name="118" href="#118">118</a>             String outputString = 
+<a name="119" href="#119">119</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
+<a name="120" href="#120">120</a>             LOG.debug(outputString);
+<a name="121" href="#121">121</a>         }
+<a name="122" href="#122">122</a>         WSSConfig wssConfig = secEngine.getWssConfig();
+<a name="123" href="#123">123</a>         wssConfig.setAllowNamespaceQualifiedPasswordTypes(<strong class="jxr_keyword">true</strong>);
+<a name="124" href="#124">124</a>         secEngine.setWssConfig(wssConfig);
+<a name="125" href="#125">125</a>         verify(doc);
+<a name="126" href="#126">126</a>     }
+<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">     * Verifies the soap envelope</em>
+<a name="131" href="#131">131</a> <em class="jxr_javadoccomment">     * </em>
+<a name="132" href="#132">132</a> <em class="jxr_javadoccomment">     * @param env soap envelope</em>
+<a name="133" href="#133">133</a> <em class="jxr_javadoccomment">     * @throws java.lang.Exception Thrown when there is a problem in verification</em>
+<a name="134" href="#134">134</a> <em class="jxr_javadoccomment">     */</em>
+<a name="135" href="#135">135</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> verify(Document doc) <strong class="jxr_keyword">throws</strong> Exception {
+<a name="136" href="#136">136</a>         LOG.info(<span class="jxr_string">"Before verifying UsernameToken...."</span>);
+<a name="137" href="#137">137</a>         secEngine.processSecurityHeader(doc, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">this</strong>, <strong class="jxr_keyword">null</strong>);
+<a name="138" href="#138">138</a>         LOG.info(<span class="jxr_string">"After verifying UsernameToken...."</span>);
+<a name="139" href="#139">139</a>     }
+<a name="140" href="#140">140</a> 
+<a name="141" href="#141">141</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> handle(Callback[] callbacks)
+<a name="142" href="#142">142</a>         <strong class="jxr_keyword">throws</strong> IOException, UnsupportedCallbackException {
+<a name="143" href="#143">143</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; callbacks.length; i++) {
+<a name="144" href="#144">144</a>             <strong class="jxr_keyword">if</strong> (callbacks[i] instanceof WSPasswordCallback) {
+<a name="145" href="#145">145</a>                 WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
+<a name="146" href="#146">146</a>                 assertEquals(pc.getPasswordType(), WSConstants.PASSWORD_TEXT);
+<a name="147" href="#147">147</a>                 <strong class="jxr_keyword">if</strong> (pc.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {
+<a name="148" href="#148">148</a>                     <strong class="jxr_keyword">if</strong> (!<span class="jxr_string">"wernerd"</span>.equals(pc.getIdentifier())
+<a name="149" href="#149">149</a>                           &amp;&amp; !<span class="jxr_string">"verySecret"</span>.equals(pc.getPassword())) {
+<a name="150" href="#150">150</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IOException(<span class="jxr_string">"Authentication failed"</span>);
+<a name="151" href="#151">151</a>                     }
+<a name="152" href="#152">152</a>                 } <strong class="jxr_keyword">else</strong> {
+<a name="153" href="#153">153</a>                     <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IOException(<span class="jxr_string">"Authentication failed"</span>);
+<a name="154" href="#154">154</a>                 }
+<a name="155" href="#155">155</a>             } <strong class="jxr_keyword">else</strong> {
+<a name="156" href="#156">156</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> UnsupportedCallbackException(callbacks[i], <span class="jxr_string">"Unrecognized Callback"</span>);
+<a name="157" href="#157">157</a>             }
+<a name="158" href="#158">158</a>         }
+<a name="159" href="#159">159</a>     }
+<a name="160" href="#160">160</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-test/wssec/TestWSSecurityWSS86.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS86.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS86.html (original)
+++ webservices/wss4j/site/xref-test/wssec/TestWSSecurityWSS86.html Tue Jul 28 13:23:48 2009
@@ -118,156 +118,157 @@
 <a name="108" href="#108">108</a>         AxisClient tmpEngine = <strong class="jxr_keyword">new</strong> AxisClient(<strong class="jxr_keyword">new</strong> NullProvider());
 <a name="109" href="#109">109</a>         msgContext = <strong class="jxr_keyword">new</strong> MessageContext(tmpEngine);
 <a name="110" href="#110">110</a>         message = getSOAPMessage();
-<a name="111" href="#111">111</a>     }
-<a name="112" href="#112">112</a> 
-<a name="113" href="#113">113</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="114" href="#114">114</a> <em class="jxr_javadoccomment">     * Constructs a soap envelope</em>
-<a name="115" href="#115">115</a> <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
-<a name="116" href="#116">116</a> <em class="jxr_javadoccomment">     * </em>
-<a name="117" href="#117">117</a> <em class="jxr_javadoccomment">     * @return soap envelope</em>
-<a name="118" href="#118">118</a> <em class="jxr_javadoccomment">     * @throws Exception if there is any problem constructing the soap envelope</em>
-<a name="119" href="#119">119</a> <em class="jxr_javadoccomment">     */</em>
-<a name="120" href="#120">120</a>     <strong class="jxr_keyword">protected</strong> Message getSOAPMessage() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="121" href="#121">121</a>         InputStream in = <strong class="jxr_keyword">new</strong> ByteArrayInputStream(SOAPMSG.getBytes());
-<a name="122" href="#122">122</a>         Message msg = <strong class="jxr_keyword">new</strong> Message(in);
-<a name="123" href="#123">123</a>         msg.setMessageContext(msgContext);
-<a name="124" href="#124">124</a>         <strong class="jxr_keyword">return</strong> msg;
-<a name="125" href="#125">125</a>     }
-<a name="126" href="#126">126</a> 
-<a name="127" href="#127">127</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="128" href="#128">128</a> <em class="jxr_javadoccomment">     * A unit test...</em>
-<a name="129" href="#129">129</a> <em class="jxr_javadoccomment">     */</em>
-<a name="130" href="#130">130</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetAliasWithPlainIssuer() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="131" href="#131">131</a>         String issuer = <span class="jxr_string">"EMAILADDRESS=Werner@example.com,CN=Werner,OU=WSS4J,O=Apache,L=Munich,ST=Bayern,C=DE"</span>;
-<a name="132" href="#132">132</a>         String alias = crypto.getAliasForX509Cert(issuer);
-<a name="133" href="#133">133</a>         assertNotNull(<span class="jxr_string">"Alias not found using plain issuer only"</span>, alias);
-<a name="134" href="#134">134</a>     }
-<a name="135" href="#135">135</a> 
-<a name="136" href="#136">136</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="137" href="#137">137</a> <em class="jxr_javadoccomment">     * A unit test...</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> <strong class="jxr_keyword">void</strong> testGetAliasWithEncodedIssuer() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="140" href="#140">140</a>         String issuer = <span class="jxr_string">"1.2.840.113549.1.9.1=#16125765726e6572406578616d706c652e636f6d,CN=Werner,OU=WSS4J,O=Apache,L=Munich,ST=Bayern,C=DE"</span>;
-<a name="141" href="#141">141</a>         String alias = crypto.getAliasForX509Cert(issuer);
-<a name="142" href="#142">142</a>         assertNotNull(<span class="jxr_string">"Alias not found using encoded issuer only"</span>, alias);
-<a name="143" href="#143">143</a>     }
-<a name="144" href="#144">144</a> 
-<a name="145" href="#145">145</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="146" href="#146">146</a> <em class="jxr_javadoccomment">     * A unit test...</em>
-<a name="147" href="#147">147</a> <em class="jxr_javadoccomment">     */</em>
-<a name="148" href="#148">148</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetAliasWithMicrosoftState() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="149" href="#149">149</a>         String issuer = <span class="jxr_string">"EMAILADDRESS=Werner@example.com,CN=Werner,OU=WSS4J,O=Apache,L=Munich,S=Bayern,C=DE"</span>;
-<a name="150" href="#150">150</a>         String alias = crypto.getAliasForX509Cert(issuer);
-<a name="151" href="#151">151</a>         assertNotNull(<span class="jxr_string">"Alias not found using Microsoft style states (S= instead of ST=)"</span>, alias);
-<a name="152" href="#152">152</a>     }
-<a name="153" href="#153">153</a>     
-<a name="154" href="#154">154</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="155" href="#155">155</a> <em class="jxr_javadoccomment">     * Test signing a SOAP message using a cert with an OID</em>
-<a name="156" href="#156">156</a> <em class="jxr_javadoccomment">     */</em>
-<a name="157" href="#157">157</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSignatureOID() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="158" href="#158">158</a>         SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope();
-<a name="159" href="#159">159</a>         WSSecSignature sign = <strong class="jxr_keyword">new</strong> WSSecSignature();
-<a name="160" href="#160">160</a>         sign.setUserInfo(<span class="jxr_string">"wss86"</span>, <span class="jxr_string">"security"</span>);
-<a name="161" href="#161">161</a>         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="162" href="#162">162</a> 
-<a name="163" href="#163">163</a>         Document doc = unsignedEnvelope.getAsDocument();
-<a name="164" href="#164">164</a> 
-<a name="165" href="#165">165</a>         WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="166" href="#166">166</a>         secHeader.insertSecurityHeader(doc);
-<a name="167" href="#167">167</a>         Document signedDoc = sign.build(doc, crypto, secHeader);
-<a name="168" href="#168">168</a>         
-<a name="169" href="#169">169</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="170" href="#170">170</a>             String outputString = 
-<a name="171" href="#171">171</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);
-<a name="172" href="#172">172</a>             LOG.debug(outputString);
-<a name="173" href="#173">173</a>         }
-<a name="174" href="#174">174</a>         verify(signedDoc);
-<a name="175" href="#175">175</a>     }
-<a name="176" href="#176">176</a>     
-<a name="177" href="#177">177</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="178" href="#178">178</a> <em class="jxr_javadoccomment">     * Test loading a certificate using BouncyCastle, and using it to encrypt a message, but</em>
-<a name="179" href="#179">179</a> <em class="jxr_javadoccomment">     * decrypt the message using the Java Keystore provider</em>
-<a name="180" href="#180">180</a> <em class="jxr_javadoccomment">     */</em>
-<a name="181" href="#181">181</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testInterop() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="182" href="#182">182</a>         <em class="jxr_comment">// </em>
-<a name="183" href="#183">183</a>         <em class="jxr_comment">// This cert corresponds to the cert in wss86.keystore</em>
-<a name="184" href="#184">184</a>         <em class="jxr_comment">// Extracted with:</em>
-<a name="185" href="#185">185</a>         <em class="jxr_comment">// keytool -export -rfc -keystore wss86.keystore -alias wss86 -file wss86.cer</em>
-<a name="186" href="#186">186</a>         <em class="jxr_comment">//</em>
-<a name="187" href="#187">187</a>         byte[] certBytes = 
-<a name="188" href="#188">188</a>             org.apache.ws.security.util.Base64.decode(
-<a name="189" href="#189">189</a>                 <span class="jxr_string">"MIICfDCCAeUCBEnHoGMwDQYJKoZIhvcNAQEEBQAwgYQxCzAJBgNVBAYTAkRFMQ8wDQYDVQQIEwZC"</span>
-<a name="190" href="#190">190</a>                 + <span class="jxr_string">"YXllcm4xDzANBgNVBAcTBk11bmljaDEPMA0GA1UEChMGQXBhY2hlMQ4wDAYDVQQLEwVXU1M0SjEP"</span>
-<a name="191" href="#191">191</a>                 + <span class="jxr_string">"MA0GA1UEAxMGV2VybmVyMSEwHwYJKoZIhvcNAQkBFhJXZXJuZXJAZXhhbXBsZS5jb20wHhcNMDkw"</span>
-<a name="192" href="#192">192</a>                 + <span class="jxr_string">"MzIzMTQ0NDUxWhcNMTkwMzIxMTQ0NDUxWjCBhDELMAkGA1UEBhMCREUxDzANBgNVBAgTBkJheWVy"</span>
-<a name="193" href="#193">193</a>                 + <span class="jxr_string">"bjEPMA0GA1UEBxMGTXVuaWNoMQ8wDQYDVQQKEwZBcGFjaGUxDjAMBgNVBAsTBVdTUzRKMQ8wDQYD"</span>
-<a name="194" href="#194">194</a>                 + <span class="jxr_string">"VQQDEwZXZXJuZXIxITAfBgkqhkiG9w0BCQEWEldlcm5lckBleGFtcGxlLmNvbTCBnzANBgkqhkiG"</span>
-<a name="195" href="#195">195</a>                 + <span class="jxr_string">"9w0BAQEFAAOBjQAwgYkCgYEA3uRplw7q8y/sIR541uCrlbIMzJHXCRU3nQreGNr6dM49/LxHYffQ"</span>
-<a name="196" href="#196">196</a>                 + <span class="jxr_string">"Ex99chQh+wR6fwArFlziDRNnqslOy8zKMfGbaBaR41ZZrxvkSsIwzOhD6yAPgKVQL2vTmJAbdZ35"</span>
-<a name="197" href="#197">197</a>                 + <span class="jxr_string">"GwcOW8oe7l+NV9qmv7yrr5OhqDhFh36WhgjVLiwmP/cCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBP"</span>
-<a name="198" href="#198">198</a>                 + <span class="jxr_string">"PnR2BYn7DKn/SkU8XTgf9g2NoYcMyvQOB+Uo25/QzDdMk6HKmHl0+7mh7RAtXcBz2YqC3WbQW5U3"</span>
-<a name="199" href="#199">199</a>                 + <span class="jxr_string">"KmOH6fVxB8hw6xalBjs2YpnBx4gaHAws35KlAfkGVVe5wqnrI7ER7RBYO/7Gr7uCUq11QrGyEG8/"</span>
-<a name="200" href="#200">200</a>                 + <span class="jxr_string">"yIXktaFLxgD2R4hpfA=="</span>
-<a name="201" href="#201">201</a>             );
-<a name="202" href="#202">202</a>         CertificateFactory factory = 
-<a name="203" href="#203">203</a>             CertificateFactory.getInstance(<span class="jxr_string">"X.509"</span>, <span class="jxr_string">"BC"</span>);
-<a name="204" href="#204">204</a>         X509Certificate cert = 
-<a name="205" href="#205">205</a>             (X509Certificate)factory.generateCertificate(
-<a name="206" href="#206">206</a>                 <strong class="jxr_keyword">new</strong> java.io.ByteArrayInputStream(certBytes)
-<a name="207" href="#207">207</a>             );
-<a name="208" href="#208">208</a> 
-<a name="209" href="#209">209</a>         SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope();
-<a name="210" href="#210">210</a>         WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="211" href="#211">211</a>         encrypt.setUseThisCert(cert);
-<a name="212" href="#212">212</a>         Document doc = unsignedEnvelope.getAsDocument();
-<a name="213" href="#213">213</a>         WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="214" href="#214">214</a>         secHeader.insertSecurityHeader(doc);
-<a name="215" href="#215">215</a>         Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
-<a name="216" href="#216">216</a>         
-<a name="217" href="#217">217</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="218" href="#218">218</a>             String outputString = 
-<a name="219" href="#219">219</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="220" href="#220">220</a>             LOG.debug(outputString);
-<a name="221" href="#221">221</a>         }
-<a name="222" href="#222">222</a>         verify(encryptedDoc);
-<a name="223" href="#223">223</a>         
-<a name="224" href="#224">224</a>     }
-<a name="225" href="#225">225</a>     
-<a name="226" href="#226">226</a>     <em class="jxr_javadoccomment">/**</em>
-<a name="227" href="#227">227</a> <em class="jxr_javadoccomment">     * Verifies the soap envelope</em>
-<a name="228" href="#228">228</a> <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
-<a name="229" href="#229">229</a> <em class="jxr_javadoccomment">     * </em>
-<a name="230" href="#230">230</a> <em class="jxr_javadoccomment">     * @param doc </em>
-<a name="231" href="#231">231</a> <em class="jxr_javadoccomment">     * @throws Exception Thrown when there is a problem in verification</em>
-<a name="232" href="#232">232</a> <em class="jxr_javadoccomment">     */</em>
-<a name="233" href="#233">233</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> verify(Document doc) <strong class="jxr_keyword">throws</strong> Exception {
-<a name="234" href="#234">234</a>         secEngine.processSecurityHeader(doc, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">this</strong>, crypto);
-<a name="235" href="#235">235</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="236" href="#236">236</a>             LOG.debug(<span class="jxr_string">"Verfied and decrypted message:"</span>);
-<a name="237" href="#237">237</a>             String outputString = 
-<a name="238" href="#238">238</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
-<a name="239" href="#239">239</a>             LOG.debug(outputString);
-<a name="240" href="#240">240</a>         }
-<a name="241" href="#241">241</a>     }
-<a name="242" href="#242">242</a> 
-<a name="243" href="#243">243</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> handle(Callback[] callbacks)
-<a name="244" href="#244">244</a>         <strong class="jxr_keyword">throws</strong> IOException, UnsupportedCallbackException {
-<a name="245" href="#245">245</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; callbacks.length; i++) {
-<a name="246" href="#246">246</a>             <strong class="jxr_keyword">if</strong> (callbacks[i] instanceof WSPasswordCallback) {
-<a name="247" href="#247">247</a>                 WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
-<a name="248" href="#248">248</a>                 <em class="jxr_comment">/*</em>
-<a name="249" href="#249">249</a> <em class="jxr_comment">                 * here call a function/method to lookup the password for</em>
-<a name="250" href="#250">250</a> <em class="jxr_comment">                 * the given identifier (e.g. a user name or keystore alias)</em>
-<a name="251" href="#251">251</a> <em class="jxr_comment">                 * e.g.: pc.setPassword(passStore.getPassword(pc.getIdentfifier))</em>
-<a name="252" href="#252">252</a> <em class="jxr_comment">                 * for Testing we supply a fixed name here.</em>
-<a name="253" href="#253">253</a> <em class="jxr_comment">                 */</em>
-<a name="254" href="#254">254</a>                 pc.setPassword(<span class="jxr_string">"security"</span>);
-<a name="255" href="#255">255</a>             } <strong class="jxr_keyword">else</strong> {
-<a name="256" href="#256">256</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> UnsupportedCallbackException(callbacks[i], <span class="jxr_string">"Unrecognized Callback"</span>);
-<a name="257" href="#257">257</a>             }
-<a name="258" href="#258">258</a>         }
-<a name="259" href="#259">259</a>     }
-<a name="260" href="#260">260</a> }
+<a name="111" href="#111">111</a>         secEngine.getWssConfig(); <em class="jxr_comment">//make sure BC gets registered</em>
+<a name="112" href="#112">112</a>     }
+<a name="113" href="#113">113</a> 
+<a name="114" href="#114">114</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="115" href="#115">115</a> <em class="jxr_javadoccomment">     * Constructs a soap envelope</em>
+<a name="116" href="#116">116</a> <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
+<a name="117" href="#117">117</a> <em class="jxr_javadoccomment">     * </em>
+<a name="118" href="#118">118</a> <em class="jxr_javadoccomment">     * @return soap envelope</em>
+<a name="119" href="#119">119</a> <em class="jxr_javadoccomment">     * @throws Exception if there is any problem constructing the soap envelope</em>
+<a name="120" href="#120">120</a> <em class="jxr_javadoccomment">     */</em>
+<a name="121" href="#121">121</a>     <strong class="jxr_keyword">protected</strong> Message getSOAPMessage() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="122" href="#122">122</a>         InputStream in = <strong class="jxr_keyword">new</strong> ByteArrayInputStream(SOAPMSG.getBytes());
+<a name="123" href="#123">123</a>         Message msg = <strong class="jxr_keyword">new</strong> Message(in);
+<a name="124" href="#124">124</a>         msg.setMessageContext(msgContext);
+<a name="125" href="#125">125</a>         <strong class="jxr_keyword">return</strong> msg;
+<a name="126" href="#126">126</a>     }
+<a name="127" href="#127">127</a> 
+<a name="128" href="#128">128</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="129" href="#129">129</a> <em class="jxr_javadoccomment">     * A unit test...</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> <strong class="jxr_keyword">void</strong> testGetAliasWithPlainIssuer() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="132" href="#132">132</a>         String issuer = <span class="jxr_string">"EMAILADDRESS=Werner@example.com,CN=Werner,OU=WSS4J,O=Apache,L=Munich,ST=Bayern,C=DE"</span>;
+<a name="133" href="#133">133</a>         String alias = crypto.getAliasForX509Cert(issuer);
+<a name="134" href="#134">134</a>         assertNotNull(<span class="jxr_string">"Alias not found using plain issuer only"</span>, alias);
+<a name="135" href="#135">135</a>     }
+<a name="136" href="#136">136</a> 
+<a name="137" href="#137">137</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="138" href="#138">138</a> <em class="jxr_javadoccomment">     * A unit test...</em>
+<a name="139" href="#139">139</a> <em class="jxr_javadoccomment">     */</em>
+<a name="140" href="#140">140</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetAliasWithEncodedIssuer() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="141" href="#141">141</a>         String issuer = <span class="jxr_string">"1.2.840.113549.1.9.1=#16125765726e6572406578616d706c652e636f6d,CN=Werner,OU=WSS4J,O=Apache,L=Munich,ST=Bayern,C=DE"</span>;
+<a name="142" href="#142">142</a>         String alias = crypto.getAliasForX509Cert(issuer);
+<a name="143" href="#143">143</a>         assertNotNull(<span class="jxr_string">"Alias not found using encoded issuer only"</span>, alias);
+<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">     * A unit test...</em>
+<a name="148" href="#148">148</a> <em class="jxr_javadoccomment">     */</em>
+<a name="149" href="#149">149</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetAliasWithMicrosoftState() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="150" href="#150">150</a>         String issuer = <span class="jxr_string">"EMAILADDRESS=Werner@example.com,CN=Werner,OU=WSS4J,O=Apache,L=Munich,S=Bayern,C=DE"</span>;
+<a name="151" href="#151">151</a>         String alias = crypto.getAliasForX509Cert(issuer);
+<a name="152" href="#152">152</a>         assertNotNull(<span class="jxr_string">"Alias not found using Microsoft style states (S= instead of ST=)"</span>, alias);
+<a name="153" href="#153">153</a>     }
+<a name="154" href="#154">154</a>     
+<a name="155" href="#155">155</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="156" href="#156">156</a> <em class="jxr_javadoccomment">     * Test signing a SOAP message using a cert with an OID</em>
+<a name="157" href="#157">157</a> <em class="jxr_javadoccomment">     */</em>
+<a name="158" href="#158">158</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSignatureOID() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="159" href="#159">159</a>         SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope();
+<a name="160" href="#160">160</a>         WSSecSignature sign = <strong class="jxr_keyword">new</strong> WSSecSignature();
+<a name="161" href="#161">161</a>         sign.setUserInfo(<span class="jxr_string">"wss86"</span>, <span class="jxr_string">"security"</span>);
+<a name="162" href="#162">162</a>         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
+<a name="163" href="#163">163</a> 
+<a name="164" href="#164">164</a>         Document doc = unsignedEnvelope.getAsDocument();
+<a name="165" href="#165">165</a> 
+<a name="166" href="#166">166</a>         WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="167" href="#167">167</a>         secHeader.insertSecurityHeader(doc);
+<a name="168" href="#168">168</a>         Document signedDoc = sign.build(doc, crypto, secHeader);
+<a name="169" href="#169">169</a>         
+<a name="170" href="#170">170</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="171" href="#171">171</a>             String outputString = 
+<a name="172" href="#172">172</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);
+<a name="173" href="#173">173</a>             LOG.debug(outputString);
+<a name="174" href="#174">174</a>         }
+<a name="175" href="#175">175</a>         verify(signedDoc);
+<a name="176" href="#176">176</a>     }
+<a name="177" href="#177">177</a>     
+<a name="178" href="#178">178</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="179" href="#179">179</a> <em class="jxr_javadoccomment">     * Test loading a certificate using BouncyCastle, and using it to encrypt a message, but</em>
+<a name="180" href="#180">180</a> <em class="jxr_javadoccomment">     * decrypt the message using the Java Keystore provider</em>
+<a name="181" href="#181">181</a> <em class="jxr_javadoccomment">     */</em>
+<a name="182" href="#182">182</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testInterop() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="183" href="#183">183</a>         <em class="jxr_comment">// </em>
+<a name="184" href="#184">184</a>         <em class="jxr_comment">// This cert corresponds to the cert in wss86.keystore</em>
+<a name="185" href="#185">185</a>         <em class="jxr_comment">// Extracted with:</em>
+<a name="186" href="#186">186</a>         <em class="jxr_comment">// keytool -export -rfc -keystore wss86.keystore -alias wss86 -file wss86.cer</em>
+<a name="187" href="#187">187</a>         <em class="jxr_comment">//</em>
+<a name="188" href="#188">188</a>         byte[] certBytes = 
+<a name="189" href="#189">189</a>             org.apache.ws.security.util.Base64.decode(
+<a name="190" href="#190">190</a>                 <span class="jxr_string">"MIICfDCCAeUCBEnHoGMwDQYJKoZIhvcNAQEEBQAwgYQxCzAJBgNVBAYTAkRFMQ8wDQYDVQQIEwZC"</span>
+<a name="191" href="#191">191</a>                 + <span class="jxr_string">"YXllcm4xDzANBgNVBAcTBk11bmljaDEPMA0GA1UEChMGQXBhY2hlMQ4wDAYDVQQLEwVXU1M0SjEP"</span>
+<a name="192" href="#192">192</a>                 + <span class="jxr_string">"MA0GA1UEAxMGV2VybmVyMSEwHwYJKoZIhvcNAQkBFhJXZXJuZXJAZXhhbXBsZS5jb20wHhcNMDkw"</span>
+<a name="193" href="#193">193</a>                 + <span class="jxr_string">"MzIzMTQ0NDUxWhcNMTkwMzIxMTQ0NDUxWjCBhDELMAkGA1UEBhMCREUxDzANBgNVBAgTBkJheWVy"</span>
+<a name="194" href="#194">194</a>                 + <span class="jxr_string">"bjEPMA0GA1UEBxMGTXVuaWNoMQ8wDQYDVQQKEwZBcGFjaGUxDjAMBgNVBAsTBVdTUzRKMQ8wDQYD"</span>
+<a name="195" href="#195">195</a>                 + <span class="jxr_string">"VQQDEwZXZXJuZXIxITAfBgkqhkiG9w0BCQEWEldlcm5lckBleGFtcGxlLmNvbTCBnzANBgkqhkiG"</span>
+<a name="196" href="#196">196</a>                 + <span class="jxr_string">"9w0BAQEFAAOBjQAwgYkCgYEA3uRplw7q8y/sIR541uCrlbIMzJHXCRU3nQreGNr6dM49/LxHYffQ"</span>
+<a name="197" href="#197">197</a>                 + <span class="jxr_string">"Ex99chQh+wR6fwArFlziDRNnqslOy8zKMfGbaBaR41ZZrxvkSsIwzOhD6yAPgKVQL2vTmJAbdZ35"</span>
+<a name="198" href="#198">198</a>                 + <span class="jxr_string">"GwcOW8oe7l+NV9qmv7yrr5OhqDhFh36WhgjVLiwmP/cCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBP"</span>
+<a name="199" href="#199">199</a>                 + <span class="jxr_string">"PnR2BYn7DKn/SkU8XTgf9g2NoYcMyvQOB+Uo25/QzDdMk6HKmHl0+7mh7RAtXcBz2YqC3WbQW5U3"</span>
+<a name="200" href="#200">200</a>                 + <span class="jxr_string">"KmOH6fVxB8hw6xalBjs2YpnBx4gaHAws35KlAfkGVVe5wqnrI7ER7RBYO/7Gr7uCUq11QrGyEG8/"</span>
+<a name="201" href="#201">201</a>                 + <span class="jxr_string">"yIXktaFLxgD2R4hpfA=="</span>
+<a name="202" href="#202">202</a>             );
+<a name="203" href="#203">203</a>         CertificateFactory factory = 
+<a name="204" href="#204">204</a>             CertificateFactory.getInstance(<span class="jxr_string">"X.509"</span>, <span class="jxr_string">"BC"</span>);
+<a name="205" href="#205">205</a>         X509Certificate cert = 
+<a name="206" href="#206">206</a>             (X509Certificate)factory.generateCertificate(
+<a name="207" href="#207">207</a>                 <strong class="jxr_keyword">new</strong> java.io.ByteArrayInputStream(certBytes)
+<a name="208" href="#208">208</a>             );
+<a name="209" href="#209">209</a> 
+<a name="210" href="#210">210</a>         SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope();
+<a name="211" href="#211">211</a>         WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="212" href="#212">212</a>         encrypt.setUseThisCert(cert);
+<a name="213" href="#213">213</a>         Document doc = unsignedEnvelope.getAsDocument();
+<a name="214" href="#214">214</a>         WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="215" href="#215">215</a>         secHeader.insertSecurityHeader(doc);
+<a name="216" href="#216">216</a>         Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="217" href="#217">217</a>         
+<a name="218" href="#218">218</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="219" href="#219">219</a>             String outputString = 
+<a name="220" href="#220">220</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="221" href="#221">221</a>             LOG.debug(outputString);
+<a name="222" href="#222">222</a>         }
+<a name="223" href="#223">223</a>         verify(encryptedDoc);
+<a name="224" href="#224">224</a>         
+<a name="225" href="#225">225</a>     }
+<a name="226" href="#226">226</a>     
+<a name="227" href="#227">227</a>     <em class="jxr_javadoccomment">/**</em>
+<a name="228" href="#228">228</a> <em class="jxr_javadoccomment">     * Verifies the soap envelope</em>
+<a name="229" href="#229">229</a> <em class="jxr_javadoccomment">     * &lt;p/&gt;</em>
+<a name="230" href="#230">230</a> <em class="jxr_javadoccomment">     * </em>
+<a name="231" href="#231">231</a> <em class="jxr_javadoccomment">     * @param doc </em>
+<a name="232" href="#232">232</a> <em class="jxr_javadoccomment">     * @throws Exception Thrown when there is a problem in verification</em>
+<a name="233" href="#233">233</a> <em class="jxr_javadoccomment">     */</em>
+<a name="234" href="#234">234</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> verify(Document doc) <strong class="jxr_keyword">throws</strong> Exception {
+<a name="235" href="#235">235</a>         secEngine.processSecurityHeader(doc, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">this</strong>, crypto);
+<a name="236" href="#236">236</a>         <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="237" href="#237">237</a>             LOG.debug(<span class="jxr_string">"Verfied and decrypted message:"</span>);
+<a name="238" href="#238">238</a>             String outputString = 
+<a name="239" href="#239">239</a>                 org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
+<a name="240" href="#240">240</a>             LOG.debug(outputString);
+<a name="241" href="#241">241</a>         }
+<a name="242" href="#242">242</a>     }
+<a name="243" href="#243">243</a> 
+<a name="244" href="#244">244</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> handle(Callback[] callbacks)
+<a name="245" href="#245">245</a>         <strong class="jxr_keyword">throws</strong> IOException, UnsupportedCallbackException {
+<a name="246" href="#246">246</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; callbacks.length; i++) {
+<a name="247" href="#247">247</a>             <strong class="jxr_keyword">if</strong> (callbacks[i] instanceof WSPasswordCallback) {
+<a name="248" href="#248">248</a>                 WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
+<a name="249" href="#249">249</a>                 <em class="jxr_comment">/*</em>
+<a name="250" href="#250">250</a> <em class="jxr_comment">                 * here call a function/method to lookup the password for</em>
+<a name="251" href="#251">251</a> <em class="jxr_comment">                 * the given identifier (e.g. a user name or keystore alias)</em>
+<a name="252" href="#252">252</a> <em class="jxr_comment">                 * e.g.: pc.setPassword(passStore.getPassword(pc.getIdentfifier))</em>
+<a name="253" href="#253">253</a> <em class="jxr_comment">                 * for Testing we supply a fixed name here.</em>
+<a name="254" href="#254">254</a> <em class="jxr_comment">                 */</em>
+<a name="255" href="#255">255</a>                 pc.setPassword(<span class="jxr_string">"security"</span>);
+<a name="256" href="#256">256</a>             } <strong class="jxr_keyword">else</strong> {
+<a name="257" href="#257">257</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> UnsupportedCallbackException(callbacks[i], <span class="jxr_string">"Unrecognized Callback"</span>);
+<a name="258" href="#258">258</a>             }
+<a name="259" href="#259">259</a>         }
+<a name="260" href="#260">260</a>     }
+<a name="261" href="#261">261</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-test/wssec/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref-test/wssec/package-frame.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref-test/wssec/package-frame.html (original)
+++ webservices/wss4j/site/xref-test/wssec/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 wssec</title>
+		<title>WSS4J 1.5.8 Reference Package wssec</title>
 		<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="style" />
 	</head>
 	<body>
@@ -25,7 +25,7 @@
             	<a href="TestWSSecurityGetPassword.html" target="classFrame">MyCallbackHandler</a>
           	</li>
           	          	<li>
-            	<a href="TestWSSecurityGetPassword.html" target="classFrame">MyHandler</a>
+            	<a href="TestWSSecurityResultsOrder.html" target="classFrame">MyHandler</a>
           	</li>
           	          	<li>
             	<a href="MyProcessor.html" target="classFrame">MyProcessor</a>
@@ -136,6 +136,9 @@
             	<a href="TestWSSecurityNewST3.html" target="classFrame">TestWSSecurityNewST3</a>
           	</li>
           	          	<li>
+            	<a href="TestWSSecurityResultsOrder.html" target="classFrame">TestWSSecurityResultsOrder</a>
+          	</li>
+          	          	<li>
             	<a href="TestWSSecuritySignatureParts.html" target="classFrame">TestWSSecuritySignatureParts</a>
           	</li>
           	          	<li>
@@ -151,6 +154,15 @@
             	<a href="TestWSSecurityUserProcessor.html" target="classFrame">TestWSSecurityUserProcessor</a>
           	</li>
           	          	<li>
+            	<a href="TestWSSecurityWSS178.html" target="classFrame">TestWSSecurityWSS178</a>
+          	</li>
+          	          	<li>
+            	<a href="TestWSSecurityWSS194.html" target="classFrame">TestWSSecurityWSS194</a>
+          	</li>
+          	          	<li>
+            	<a href="TestWSSecurityWSS199.html" target="classFrame">TestWSSecurityWSS199</a>
+          	</li>
+          	          	<li>
             	<a href="TestWSSecurityWSS60.html" target="classFrame">TestWSSecurityWSS60</a>
           	</li>
           	          	<li>

Modified: webservices/wss4j/site/xref-test/wssec/package-summary.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref-test/wssec/package-summary.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref-test/wssec/package-summary.html (original)
+++ webservices/wss4j/site/xref-test/wssec/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 wssec</title>
+		<title>WSS4J 1.5.8 Reference Package wssec</title>
 		<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="style" />
 	</head>
 	<body>
@@ -52,7 +52,7 @@
             	</tr>
 				            	<tr>
               		<td>
-                		<a href="TestWSSecurityGetPassword.html" target="classFrame">MyHandler</a>
+                		<a href="TestWSSecurityResultsOrder.html" target="classFrame">MyHandler</a>
               		</td>
             	</tr>
 				            	<tr>
@@ -237,6 +237,11 @@
             	</tr>
 				            	<tr>
               		<td>
+                		<a href="TestWSSecurityResultsOrder.html" target="classFrame">TestWSSecurityResultsOrder</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
                 		<a href="TestWSSecuritySignatureParts.html" target="classFrame">TestWSSecuritySignatureParts</a>
               		</td>
             	</tr>
@@ -262,6 +267,21 @@
             	</tr>
 				            	<tr>
               		<td>
+                		<a href="TestWSSecurityWSS178.html" target="classFrame">TestWSSecurityWSS178</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
+                		<a href="TestWSSecurityWSS194.html" target="classFrame">TestWSSecurityWSS194</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
+                		<a href="TestWSSecurityWSS199.html" target="classFrame">TestWSSecurityWSS199</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
                 		<a href="TestWSSecurityWSS60.html" target="classFrame">TestWSSecurityWSS60</a>
               		</td>
             	</tr>

Modified: webservices/wss4j/site/xref/index.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/index.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/index.html (original)
+++ webservices/wss4j/site/xref/index.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</title>
+		<title>WSS4J 1.5.8 Reference</title>
 	</head>
     <frameset cols="20%,80%">
 		<frameset rows="30%,70%">

Modified: webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/package-frame.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/package-frame.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/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.axis.security.handler</title>
+		<title>WSS4J 1.5.8 Reference Package org.apache.ws.axis.security.handler</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/package-summary.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/package-summary.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/package-summary.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/axis/security/handler/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.axis.security.handler</title>
+		<title>WSS4J 1.5.8 Reference Package org.apache.ws.axis.security.handler</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: webservices/wss4j/site/xref/org/apache/ws/axis/security/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/axis/security/package-frame.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/axis/security/package-frame.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/axis/security/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.axis.security</title>
+		<title>WSS4J 1.5.8 Reference Package org.apache.ws.axis.security</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: webservices/wss4j/site/xref/org/apache/ws/axis/security/package-summary.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/axis/security/package-summary.html?rev=798514&r1=798513&r2=798514&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/axis/security/package-summary.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/axis/security/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.axis.security</title>
+		<title>WSS4J 1.5.8 Reference Package org.apache.ws.axis.security</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