You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2011/06/07 18:25:52 UTC
svn commit: r1133081 [16/50] - in /webservices/wss4j/site: ./ apidocs/
apidocs/org/apache/ws/security/ apidocs/org/apache/ws/security/action/
apidocs/org/apache/ws/security/action/class-use/
apidocs/org/apache/ws/security/class-use/ apidocs/org/apache/...
Modified: webservices/wss4j/site/xref-test/org/apache/ws/security/message/EncryptionPartsTest.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref-test/org/apache/ws/security/message/EncryptionPartsTest.html?rev=1133081&r1=1133080&r2=1133081&view=diff
==============================================================================
--- webservices/wss4j/site/xref-test/org/apache/ws/security/message/EncryptionPartsTest.html (original)
+++ webservices/wss4j/site/xref-test/org/apache/ws/security/message/EncryptionPartsTest.html Tue Jun 7 16:25:20 2011
@@ -61,393 +61,395 @@
<a name="51" href="#51">51</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> String SOAPMSG = <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span> +
<a name="52" href="#52">52</a> <span class="jxr_string">"<soapenv:Envelope xmlns:foo=\"urn:foo.bar\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"</span> +
<a name="53" href="#53">53</a> <span class="jxr_string">" <soapenv:Header>"</span> +
-<a name="54" href="#54">54</a> <span class="jxr_string">" <foo:foobar>baz</foo:foobar>"</span> +
-<a name="55" href="#55">55</a> <span class="jxr_string">" </soapenv:Header>"</span> +
-<a name="56" href="#56">56</a> <span class="jxr_string">" <soapenv:Body>"</span> +
-<a name="57" href="#57">57</a> <span class="jxr_string">" <ns1:testMethod xmlns:ns1=\"http://axis/service/security/test6/LogTestService8\"></ns1:testMethod>"</span> +
-<a name="58" href="#58">58</a> <span class="jxr_string">" </soapenv:Body>"</span> +
-<a name="59" href="#59">59</a> <span class="jxr_string">"</soapenv:Envelope>"</span>;
-<a name="60" href="#60">60</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> String SOAPMSG_MULTIPLE = <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span> +
-<a name="61" href="#61">61</a> <span class="jxr_string">"<soapenv:Envelope xmlns:foo=\"urn:foo.bar\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"</span> +
-<a name="62" href="#62">62</a> <span class="jxr_string">" <soapenv:Header>"</span> +
-<a name="63" href="#63">63</a> <span class="jxr_string">" <foo:foobar>baz</foo:foobar>"</span> +
-<a name="64" href="#64">64</a> <span class="jxr_string">" </soapenv:Header>"</span> +
-<a name="65" href="#65">65</a> <span class="jxr_string">" <soapenv:Body>"</span> +
-<a name="66" href="#66">66</a> <span class="jxr_string">" <ns1:testMethod xmlns:ns1=\"http://axis/service/security/test6/LogTestService8\">asf1</ns1:testMethod>"</span> +
-<a name="67" href="#67">67</a> <span class="jxr_string">" <ns1:testMethod xmlns:ns1=\"http://axis/service/security/test6/LogTestService8\">asf2</ns1:testMethod>"</span> +
-<a name="68" href="#68">68</a> <span class="jxr_string">" </soapenv:Body>"</span> +
-<a name="69" href="#69">69</a> <span class="jxr_string">"</soapenv:Envelope>"</span>;
-<a name="70" href="#70">70</a>
-<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> CallbackHandler callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
-<a name="73" href="#73">73</a> <strong class="jxr_keyword">private</strong> Crypto crypto = <strong class="jxr_keyword">null</strong>;
-<a name="74" href="#74">74</a>
-<a name="75" href="#75">75</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/ws/security/message/EncryptionPartsTest.html">EncryptionPartsTest</a>() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="76" href="#76">76</a> crypto = CryptoFactory.getInstance();
-<a name="77" href="#77">77</a> WSSConfig.init();
-<a name="78" href="#78">78</a> }
-<a name="79" href="#79">79</a>
-<a name="80" href="#80">80</a> <em class="jxr_javadoccomment">/**</em>
-<a name="81" href="#81">81</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header</em>
-<a name="82" href="#82">82</a> <em class="jxr_javadoccomment"> */</em>
-<a name="83" href="#83">83</a> @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
-<a name="84" href="#84">84</a> @org.junit.Test
-<a name="85" href="#85">85</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSOAPHeader() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="86" href="#86">86</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="87" href="#87">87</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="88" href="#88">88</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="89" href="#89">89</a>
-<a name="90" href="#90">90</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
-<a name="91" href="#91">91</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="92" href="#92">92</a> secHeader.insertSecurityHeader(doc);
-<a name="93" href="#93">93</a>
-<a name="94" href="#94">94</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="95" href="#95">95</a> WSEncryptionPart encP =
-<a name="96" href="#96">96</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="97" href="#97">97</a> <span class="jxr_string">"foobar"</span>,
-<a name="98" href="#98">98</a> <span class="jxr_string">"urn:foo.bar"</span>,
-<a name="99" href="#99">99</a> <span class="jxr_string">""</span>);
-<a name="100" href="#100">100</a> parts.add(encP);
-<a name="101" href="#101">101</a> encrypt.setParts(parts);
-<a name="102" href="#102">102</a>
-<a name="103" href="#103">103</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="54" href="#54">54</a> <span class="jxr_string">" <foo:bar1>baz1</foo:bar1>"</span> +
+<a name="55" href="#55">55</a> <span class="jxr_string">" <foo:foobar>baz</foo:foobar>"</span> +
+<a name="56" href="#56">56</a> <span class="jxr_string">" <foo:bar2>baz2</foo:bar2>"</span> +
+<a name="57" href="#57">57</a> <span class="jxr_string">" </soapenv:Header>"</span> +
+<a name="58" href="#58">58</a> <span class="jxr_string">" <soapenv:Body>"</span> +
+<a name="59" href="#59">59</a> <span class="jxr_string">" <ns1:testMethod xmlns:ns1=\"http://axis/service/security/test6/LogTestService8\"></ns1:testMethod>"</span> +
+<a name="60" href="#60">60</a> <span class="jxr_string">" </soapenv:Body>"</span> +
+<a name="61" href="#61">61</a> <span class="jxr_string">"</soapenv:Envelope>"</span>;
+<a name="62" href="#62">62</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> String SOAPMSG_MULTIPLE = <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span> +
+<a name="63" href="#63">63</a> <span class="jxr_string">"<soapenv:Envelope xmlns:foo=\"urn:foo.bar\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"</span> +
+<a name="64" href="#64">64</a> <span class="jxr_string">" <soapenv:Header>"</span> +
+<a name="65" href="#65">65</a> <span class="jxr_string">" <foo:foobar>baz</foo:foobar>"</span> +
+<a name="66" href="#66">66</a> <span class="jxr_string">" </soapenv:Header>"</span> +
+<a name="67" href="#67">67</a> <span class="jxr_string">" <soapenv:Body>"</span> +
+<a name="68" href="#68">68</a> <span class="jxr_string">" <ns1:testMethod xmlns:ns1=\"http://axis/service/security/test6/LogTestService8\">asf1</ns1:testMethod>"</span> +
+<a name="69" href="#69">69</a> <span class="jxr_string">" <ns1:testMethod xmlns:ns1=\"http://axis/service/security/test6/LogTestService8\">asf2</ns1:testMethod>"</span> +
+<a name="70" href="#70">70</a> <span class="jxr_string">" </soapenv:Body>"</span> +
+<a name="71" href="#71">71</a> <span class="jxr_string">"</soapenv:Envelope>"</span>;
+<a name="72" href="#72">72</a>
+<a name="73" href="#73">73</a> <strong class="jxr_keyword">private</strong> WSSecurityEngine secEngine = <strong class="jxr_keyword">new</strong> WSSecurityEngine();
+<a name="74" href="#74">74</a> <strong class="jxr_keyword">private</strong> CallbackHandler callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
+<a name="75" href="#75">75</a> <strong class="jxr_keyword">private</strong> Crypto crypto = <strong class="jxr_keyword">null</strong>;
+<a name="76" href="#76">76</a>
+<a name="77" href="#77">77</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/ws/security/message/EncryptionPartsTest.html">EncryptionPartsTest</a>() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="78" href="#78">78</a> crypto = CryptoFactory.getInstance();
+<a name="79" href="#79">79</a> WSSConfig.init();
+<a name="80" href="#80">80</a> }
+<a name="81" href="#81">81</a>
+<a name="82" href="#82">82</a> <em class="jxr_javadoccomment">/**</em>
+<a name="83" href="#83">83</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header</em>
+<a name="84" href="#84">84</a> <em class="jxr_javadoccomment"> */</em>
+<a name="85" href="#85">85</a> @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
+<a name="86" href="#86">86</a> @org.junit.Test
+<a name="87" href="#87">87</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSOAPHeader() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="88" href="#88">88</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="89" href="#89">89</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="90" href="#90">90</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
+<a name="91" href="#91">91</a>
+<a name="92" href="#92">92</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="93" href="#93">93</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="94" href="#94">94</a> secHeader.insertSecurityHeader(doc);
+<a name="95" href="#95">95</a>
+<a name="96" href="#96">96</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="97" href="#97">97</a> WSEncryptionPart encP =
+<a name="98" href="#98">98</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="99" href="#99">99</a> <span class="jxr_string">"foobar"</span>,
+<a name="100" href="#100">100</a> <span class="jxr_string">"urn:foo.bar"</span>,
+<a name="101" href="#101">101</a> <span class="jxr_string">""</span>);
+<a name="102" href="#102">102</a> parts.add(encP);
+<a name="103" href="#103">103</a> encrypt.setParts(parts);
<a name="104" href="#104">104</a>
-<a name="105" href="#105">105</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="106" href="#106">106</a> String outputString =
-<a name="107" href="#107">107</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="108" href="#108">108</a> LOG.debug(outputString);
-<a name="109" href="#109">109</a> }
-<a name="110" href="#110">110</a>
-<a name="111" href="#111">111</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="105" href="#105">105</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="106" href="#106">106</a>
+<a name="107" href="#107">107</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="108" href="#108">108</a> String outputString =
+<a name="109" href="#109">109</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="110" href="#110">110</a> LOG.debug(outputString);
+<a name="111" href="#111">111</a> }
<a name="112" href="#112">112</a>
-<a name="113" href="#113">113</a> QName name = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar"</span>);
-<a name="114" href="#114">114</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{name});
-<a name="115" href="#115">115</a> <strong class="jxr_keyword">try</strong> {
-<a name="116" href="#116">116</a> name = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar2"</span>);
-<a name="117" href="#117">117</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{name});
-<a name="118" href="#118">118</a> fail(<span class="jxr_string">"Failure expected on a wrong protected part"</span>);
-<a name="119" href="#119">119</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="120" href="#120">120</a> <em class="jxr_comment">// expected</em>
-<a name="121" href="#121">121</a> }
-<a name="122" href="#122">122</a> <strong class="jxr_keyword">try</strong> {
-<a name="123" href="#123">123</a> name = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar"</span>);
-<a name="124" href="#124">124</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.SIGN, <strong class="jxr_keyword">new</strong> QName[]{name});
-<a name="125" href="#125">125</a> fail(<span class="jxr_string">"Failure expected on a wrong action"</span>);
-<a name="126" href="#126">126</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="127" href="#127">127</a> <em class="jxr_comment">// expected</em>
-<a name="128" href="#128">128</a> }
-<a name="129" href="#129">129</a>
-<a name="130" href="#130">130</a> WSSecurityEngineResult actionResult =
-<a name="131" href="#131">131</a> WSSecurityUtil.fetchActionResult(results, WSConstants.ENCR);
-<a name="132" href="#132">132</a> assertTrue(actionResult != <strong class="jxr_keyword">null</strong>);
-<a name="133" href="#133">133</a> assertFalse(actionResult.isEmpty());
-<a name="134" href="#134">134</a> <strong class="jxr_keyword">final</strong> java.util.List<WSDataRef> refs =
-<a name="135" href="#135">135</a> (java.util.List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS);
-<a name="136" href="#136">136</a>
-<a name="137" href="#137">137</a> assertEquals(WSConstants.KEYTRANSPORT_RSA15,
-<a name="138" href="#138">138</a> actionResult.get(WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD));
-<a name="139" href="#139">139</a>
-<a name="140" href="#140">140</a> WSDataRef wsDataRef = (WSDataRef)refs.get(0);
-<a name="141" href="#141">141</a> String xpath = wsDataRef.getXpath();
-<a name="142" href="#142">142</a> assertEquals(<span class="jxr_string">"/soapenv:Envelope/soapenv:Header/foo:foobar"</span>, xpath);
-<a name="143" href="#143">143</a> assertEquals(WSConstants.AES_128, wsDataRef.getAlgorithm());
-<a name="144" href="#144">144</a> }
-<a name="145" href="#145">145</a>
-<a name="146" href="#146">146</a>
-<a name="147" href="#147">147</a> <em class="jxr_javadoccomment">/**</em>
-<a name="148" href="#148">148</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header using wsse11:EncryptedHeader</em>
-<a name="149" href="#149">149</a> <em class="jxr_javadoccomment"> */</em>
-<a name="150" href="#150">150</a> @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
-<a name="151" href="#151">151</a> @org.junit.Test
-<a name="152" href="#152">152</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSOAPEncryptedHeader() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="153" href="#153">153</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="154" href="#154">154</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="155" href="#155">155</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="156" href="#156">156</a>
-<a name="157" href="#157">157</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
-<a name="158" href="#158">158</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="159" href="#159">159</a> secHeader.insertSecurityHeader(doc);
-<a name="160" href="#160">160</a>
-<a name="161" href="#161">161</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="162" href="#162">162</a> WSEncryptionPart encP =
-<a name="163" href="#163">163</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="164" href="#164">164</a> <span class="jxr_string">"foobar"</span>,
-<a name="165" href="#165">165</a> <span class="jxr_string">"urn:foo.bar"</span>,
-<a name="166" href="#166">166</a> <span class="jxr_string">"Header"</span>);
-<a name="167" href="#167">167</a> parts.add(encP);
-<a name="168" href="#168">168</a> encrypt.setParts(parts);
-<a name="169" href="#169">169</a>
-<a name="170" href="#170">170</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="113" href="#113">113</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="114" href="#114">114</a>
+<a name="115" href="#115">115</a> QName name = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar"</span>);
+<a name="116" href="#116">116</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{name});
+<a name="117" href="#117">117</a> <strong class="jxr_keyword">try</strong> {
+<a name="118" href="#118">118</a> name = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar2"</span>);
+<a name="119" href="#119">119</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{name});
+<a name="120" href="#120">120</a> fail(<span class="jxr_string">"Failure expected on a wrong protected part"</span>);
+<a name="121" href="#121">121</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="122" href="#122">122</a> <em class="jxr_comment">// expected</em>
+<a name="123" href="#123">123</a> }
+<a name="124" href="#124">124</a> <strong class="jxr_keyword">try</strong> {
+<a name="125" href="#125">125</a> name = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar"</span>);
+<a name="126" href="#126">126</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.SIGN, <strong class="jxr_keyword">new</strong> QName[]{name});
+<a name="127" href="#127">127</a> fail(<span class="jxr_string">"Failure expected on a wrong action"</span>);
+<a name="128" href="#128">128</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="129" href="#129">129</a> <em class="jxr_comment">// expected</em>
+<a name="130" href="#130">130</a> }
+<a name="131" href="#131">131</a>
+<a name="132" href="#132">132</a> WSSecurityEngineResult actionResult =
+<a name="133" href="#133">133</a> WSSecurityUtil.fetchActionResult(results, WSConstants.ENCR);
+<a name="134" href="#134">134</a> assertTrue(actionResult != <strong class="jxr_keyword">null</strong>);
+<a name="135" href="#135">135</a> assertFalse(actionResult.isEmpty());
+<a name="136" href="#136">136</a> <strong class="jxr_keyword">final</strong> java.util.List<WSDataRef> refs =
+<a name="137" href="#137">137</a> (java.util.List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS);
+<a name="138" href="#138">138</a>
+<a name="139" href="#139">139</a> assertEquals(WSConstants.KEYTRANSPORT_RSA15,
+<a name="140" href="#140">140</a> actionResult.get(WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD));
+<a name="141" href="#141">141</a>
+<a name="142" href="#142">142</a> WSDataRef wsDataRef = (WSDataRef)refs.get(0);
+<a name="143" href="#143">143</a> String xpath = wsDataRef.getXpath();
+<a name="144" href="#144">144</a> assertEquals(<span class="jxr_string">"/soapenv:Envelope/soapenv:Header/foo:foobar"</span>, xpath);
+<a name="145" href="#145">145</a> assertEquals(WSConstants.AES_128, wsDataRef.getAlgorithm());
+<a name="146" href="#146">146</a> }
+<a name="147" href="#147">147</a>
+<a name="148" href="#148">148</a>
+<a name="149" href="#149">149</a> <em class="jxr_javadoccomment">/**</em>
+<a name="150" href="#150">150</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header using wsse11:EncryptedHeader</em>
+<a name="151" href="#151">151</a> <em class="jxr_javadoccomment"> */</em>
+<a name="152" href="#152">152</a> @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
+<a name="153" href="#153">153</a> @org.junit.Test
+<a name="154" href="#154">154</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSOAPEncryptedHeader() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="155" href="#155">155</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="156" href="#156">156</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="157" href="#157">157</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
+<a name="158" href="#158">158</a>
+<a name="159" href="#159">159</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="160" href="#160">160</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="161" href="#161">161</a> secHeader.insertSecurityHeader(doc);
+<a name="162" href="#162">162</a>
+<a name="163" href="#163">163</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="164" href="#164">164</a> WSEncryptionPart encP =
+<a name="165" href="#165">165</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="166" href="#166">166</a> <span class="jxr_string">"foobar"</span>,
+<a name="167" href="#167">167</a> <span class="jxr_string">"urn:foo.bar"</span>,
+<a name="168" href="#168">168</a> <span class="jxr_string">"Header"</span>);
+<a name="169" href="#169">169</a> parts.add(encP);
+<a name="170" href="#170">170</a> encrypt.setParts(parts);
<a name="171" href="#171">171</a>
-<a name="172" href="#172">172</a> String outputString =
-<a name="173" href="#173">173</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="174" href="#174">174</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="175" href="#175">175</a> LOG.debug(outputString);
-<a name="176" href="#176">176</a> }
-<a name="177" href="#177">177</a> assertTrue(outputString.indexOf(<span class="jxr_string">"wsse11:EncryptedHeader"</span>) != -1);
-<a name="178" href="#178">178</a> assertTrue(outputString.indexOf(<span class="jxr_string">"foo:foobar"</span>) == -1);
-<a name="179" href="#179">179</a>
-<a name="180" href="#180">180</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="172" href="#172">172</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="173" href="#173">173</a>
+<a name="174" href="#174">174</a> String outputString =
+<a name="175" href="#175">175</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="176" href="#176">176</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="177" href="#177">177</a> LOG.debug(outputString);
+<a name="178" href="#178">178</a> }
+<a name="179" href="#179">179</a> assertTrue(outputString.indexOf(<span class="jxr_string">"wsse11:EncryptedHeader"</span>) != -1);
+<a name="180" href="#180">180</a> assertTrue(outputString.indexOf(<span class="jxr_string">"foo:foobar"</span>) == -1);
<a name="181" href="#181">181</a>
-<a name="182" href="#182">182</a> WSSecurityEngineResult actionResult =
-<a name="183" href="#183">183</a> WSSecurityUtil.fetchActionResult(results, WSConstants.ENCR);
-<a name="184" href="#184">184</a> assertTrue(actionResult != <strong class="jxr_keyword">null</strong>);
-<a name="185" href="#185">185</a> assertFalse(actionResult.isEmpty());
-<a name="186" href="#186">186</a> <strong class="jxr_keyword">final</strong> java.util.List<WSDataRef> refs =
-<a name="187" href="#187">187</a> (java.util.List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS);
-<a name="188" href="#188">188</a>
-<a name="189" href="#189">189</a> assertEquals(WSConstants.KEYTRANSPORT_RSA15,
-<a name="190" href="#190">190</a> actionResult.get(WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD));
-<a name="191" href="#191">191</a>
-<a name="192" href="#192">192</a> WSDataRef wsDataRef = (WSDataRef)refs.get(0);
-<a name="193" href="#193">193</a> String xpath = wsDataRef.getXpath();
-<a name="194" href="#194">194</a> assertEquals(<span class="jxr_string">"/soapenv:Envelope/soapenv:Header/foo:foobar"</span>, xpath);
-<a name="195" href="#195">195</a> }
-<a name="196" href="#196">196</a>
-<a name="197" href="#197">197</a> <em class="jxr_javadoccomment">/**</em>
-<a name="198" href="#198">198</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header with a bad localname</em>
-<a name="199" href="#199">199</a> <em class="jxr_javadoccomment"> */</em>
-<a name="200" href="#200">200</a> @org.junit.Test
-<a name="201" href="#201">201</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testBadLocalname() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="202" href="#202">202</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="203" href="#203">203</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="204" href="#204">204</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="205" href="#205">205</a>
-<a name="206" href="#206">206</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="182" href="#182">182</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="183" href="#183">183</a>
+<a name="184" href="#184">184</a> WSSecurityEngineResult actionResult =
+<a name="185" href="#185">185</a> WSSecurityUtil.fetchActionResult(results, WSConstants.ENCR);
+<a name="186" href="#186">186</a> assertTrue(actionResult != <strong class="jxr_keyword">null</strong>);
+<a name="187" href="#187">187</a> assertFalse(actionResult.isEmpty());
+<a name="188" href="#188">188</a> <strong class="jxr_keyword">final</strong> java.util.List<WSDataRef> refs =
+<a name="189" href="#189">189</a> (java.util.List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS);
+<a name="190" href="#190">190</a>
+<a name="191" href="#191">191</a> assertEquals(WSConstants.KEYTRANSPORT_RSA15,
+<a name="192" href="#192">192</a> actionResult.get(WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD));
+<a name="193" href="#193">193</a>
+<a name="194" href="#194">194</a> WSDataRef wsDataRef = (WSDataRef)refs.get(0);
+<a name="195" href="#195">195</a> String xpath = wsDataRef.getXpath();
+<a name="196" href="#196">196</a> assertEquals(<span class="jxr_string">"/soapenv:Envelope/soapenv:Header/foo:foobar"</span>, xpath);
+<a name="197" href="#197">197</a> }
+<a name="198" href="#198">198</a>
+<a name="199" href="#199">199</a> <em class="jxr_javadoccomment">/**</em>
+<a name="200" href="#200">200</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header with a bad localname</em>
+<a name="201" href="#201">201</a> <em class="jxr_javadoccomment"> */</em>
+<a name="202" href="#202">202</a> @org.junit.Test
+<a name="203" href="#203">203</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testBadLocalname() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="204" href="#204">204</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="205" href="#205">205</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="206" href="#206">206</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
<a name="207" href="#207">207</a>
-<a name="208" href="#208">208</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="209" href="#209">209</a> secHeader.insertSecurityHeader(doc);
-<a name="210" href="#210">210</a>
-<a name="211" href="#211">211</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="212" href="#212">212</a> WSEncryptionPart encP =
-<a name="213" href="#213">213</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="214" href="#214">214</a> <span class="jxr_string">"foobar2"</span>,
-<a name="215" href="#215">215</a> <span class="jxr_string">"urn:foo.bar"</span>,
-<a name="216" href="#216">216</a> <span class="jxr_string">""</span>);
-<a name="217" href="#217">217</a> parts.add(encP);
-<a name="218" href="#218">218</a> encrypt.setParts(parts);
-<a name="219" href="#219">219</a>
-<a name="220" href="#220">220</a> <strong class="jxr_keyword">try</strong> {
-<a name="221" href="#221">221</a> encrypt.build(doc, crypto, secHeader);
-<a name="222" href="#222">222</a> fail(<span class="jxr_string">"Failure expected on a bad localname"</span>);
-<a name="223" href="#223">223</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="224" href="#224">224</a> <em class="jxr_comment">// expected</em>
-<a name="225" href="#225">225</a> }
-<a name="226" href="#226">226</a> }
-<a name="227" href="#227">227</a>
-<a name="228" href="#228">228</a>
-<a name="229" href="#229">229</a> <em class="jxr_javadoccomment">/**</em>
-<a name="230" href="#230">230</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header with a bad namespace</em>
-<a name="231" href="#231">231</a> <em class="jxr_javadoccomment"> */</em>
-<a name="232" href="#232">232</a> @org.junit.Test
-<a name="233" href="#233">233</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testBadNamespace() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="234" href="#234">234</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="235" href="#235">235</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="236" href="#236">236</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="237" href="#237">237</a>
-<a name="238" href="#238">238</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="208" href="#208">208</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="209" href="#209">209</a>
+<a name="210" href="#210">210</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="211" href="#211">211</a> secHeader.insertSecurityHeader(doc);
+<a name="212" href="#212">212</a>
+<a name="213" href="#213">213</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="214" href="#214">214</a> WSEncryptionPart encP =
+<a name="215" href="#215">215</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="216" href="#216">216</a> <span class="jxr_string">"foobar2"</span>,
+<a name="217" href="#217">217</a> <span class="jxr_string">"urn:foo.bar"</span>,
+<a name="218" href="#218">218</a> <span class="jxr_string">""</span>);
+<a name="219" href="#219">219</a> parts.add(encP);
+<a name="220" href="#220">220</a> encrypt.setParts(parts);
+<a name="221" href="#221">221</a>
+<a name="222" href="#222">222</a> <strong class="jxr_keyword">try</strong> {
+<a name="223" href="#223">223</a> encrypt.build(doc, crypto, secHeader);
+<a name="224" href="#224">224</a> fail(<span class="jxr_string">"Failure expected on a bad localname"</span>);
+<a name="225" href="#225">225</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="226" href="#226">226</a> <em class="jxr_comment">// expected</em>
+<a name="227" href="#227">227</a> }
+<a name="228" href="#228">228</a> }
+<a name="229" href="#229">229</a>
+<a name="230" href="#230">230</a>
+<a name="231" href="#231">231</a> <em class="jxr_javadoccomment">/**</em>
+<a name="232" href="#232">232</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header with a bad namespace</em>
+<a name="233" href="#233">233</a> <em class="jxr_javadoccomment"> */</em>
+<a name="234" href="#234">234</a> @org.junit.Test
+<a name="235" href="#235">235</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testBadNamespace() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="236" href="#236">236</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="237" href="#237">237</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="238" href="#238">238</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
<a name="239" href="#239">239</a>
-<a name="240" href="#240">240</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="241" href="#241">241</a> secHeader.insertSecurityHeader(doc);
-<a name="242" href="#242">242</a>
-<a name="243" href="#243">243</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="244" href="#244">244</a> WSEncryptionPart encP =
-<a name="245" href="#245">245</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="246" href="#246">246</a> <span class="jxr_string">"foobar"</span>,
-<a name="247" href="#247">247</a> <span class="jxr_string">"urn:foo.bar2"</span>,
-<a name="248" href="#248">248</a> <span class="jxr_string">""</span>);
-<a name="249" href="#249">249</a> parts.add(encP);
-<a name="250" href="#250">250</a> encrypt.setParts(parts);
-<a name="251" href="#251">251</a>
-<a name="252" href="#252">252</a> <strong class="jxr_keyword">try</strong> {
-<a name="253" href="#253">253</a> encrypt.build(doc, crypto, secHeader);
-<a name="254" href="#254">254</a> fail(<span class="jxr_string">"Failure expected on a bad namespace"</span>);
-<a name="255" href="#255">255</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="256" href="#256">256</a> <em class="jxr_comment">// expected</em>
-<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="261" href="#261">261</a> <em class="jxr_javadoccomment">/**</em>
-<a name="262" href="#262">262</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header and the SOAP body</em>
-<a name="263" href="#263">263</a> <em class="jxr_javadoccomment"> */</em>
-<a name="264" href="#264">264</a> @org.junit.Test
-<a name="265" href="#265">265</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSOAPHeaderAndBody() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="266" href="#266">266</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
-<a name="267" href="#267">267</a> SOAPConstants soapConstants =
-<a name="268" href="#268">268</a> WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
-<a name="269" href="#269">269</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="270" href="#270">270</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="271" href="#271">271</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="272" href="#272">272</a>
-<a name="273" href="#273">273</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="274" href="#274">274</a> secHeader.insertSecurityHeader(doc);
-<a name="275" href="#275">275</a>
-<a name="276" href="#276">276</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="277" href="#277">277</a> WSEncryptionPart encP =
-<a name="278" href="#278">278</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="279" href="#279">279</a> soapConstants.getBodyQName().getLocalPart(), <em class="jxr_comment">// define the body</em>
-<a name="280" href="#280">280</a> soapConstants.getEnvelopeURI(),
-<a name="281" href="#281">281</a> <span class="jxr_string">""</span>);
-<a name="282" href="#282">282</a> parts.add(encP);
-<a name="283" href="#283">283</a> WSEncryptionPart encP2 =
-<a name="284" href="#284">284</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="285" href="#285">285</a> <span class="jxr_string">"foobar"</span>,
-<a name="286" href="#286">286</a> <span class="jxr_string">"urn:foo.bar"</span>,
-<a name="287" href="#287">287</a> <span class="jxr_string">""</span>);
-<a name="288" href="#288">288</a> parts.add(encP2);
-<a name="289" href="#289">289</a> encrypt.setParts(parts);
-<a name="290" href="#290">290</a>
-<a name="291" href="#291">291</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="240" href="#240">240</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="241" href="#241">241</a>
+<a name="242" href="#242">242</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="243" href="#243">243</a> secHeader.insertSecurityHeader(doc);
+<a name="244" href="#244">244</a>
+<a name="245" href="#245">245</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="246" href="#246">246</a> WSEncryptionPart encP =
+<a name="247" href="#247">247</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="248" href="#248">248</a> <span class="jxr_string">"foobar"</span>,
+<a name="249" href="#249">249</a> <span class="jxr_string">"urn:foo.bar2"</span>,
+<a name="250" href="#250">250</a> <span class="jxr_string">""</span>);
+<a name="251" href="#251">251</a> parts.add(encP);
+<a name="252" href="#252">252</a> encrypt.setParts(parts);
+<a name="253" href="#253">253</a>
+<a name="254" href="#254">254</a> <strong class="jxr_keyword">try</strong> {
+<a name="255" href="#255">255</a> encrypt.build(doc, crypto, secHeader);
+<a name="256" href="#256">256</a> fail(<span class="jxr_string">"Failure expected on a bad namespace"</span>);
+<a name="257" href="#257">257</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="258" href="#258">258</a> <em class="jxr_comment">// expected</em>
+<a name="259" href="#259">259</a> }
+<a name="260" href="#260">260</a> }
+<a name="261" href="#261">261</a>
+<a name="262" href="#262">262</a>
+<a name="263" href="#263">263</a> <em class="jxr_javadoccomment">/**</em>
+<a name="264" href="#264">264</a> <em class="jxr_javadoccomment"> * Test encrypting a custom SOAP header and the SOAP body</em>
+<a name="265" href="#265">265</a> <em class="jxr_javadoccomment"> */</em>
+<a name="266" href="#266">266</a> @org.junit.Test
+<a name="267" href="#267">267</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSOAPHeaderAndBody() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="268" href="#268">268</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="269" href="#269">269</a> SOAPConstants soapConstants =
+<a name="270" href="#270">270</a> WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
+<a name="271" href="#271">271</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="272" href="#272">272</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="273" href="#273">273</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
+<a name="274" href="#274">274</a>
+<a name="275" href="#275">275</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="276" href="#276">276</a> secHeader.insertSecurityHeader(doc);
+<a name="277" href="#277">277</a>
+<a name="278" href="#278">278</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="279" href="#279">279</a> WSEncryptionPart encP =
+<a name="280" href="#280">280</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="281" href="#281">281</a> soapConstants.getBodyQName().getLocalPart(), <em class="jxr_comment">// define the body</em>
+<a name="282" href="#282">282</a> soapConstants.getEnvelopeURI(),
+<a name="283" href="#283">283</a> <span class="jxr_string">""</span>);
+<a name="284" href="#284">284</a> parts.add(encP);
+<a name="285" href="#285">285</a> WSEncryptionPart encP2 =
+<a name="286" href="#286">286</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="287" href="#287">287</a> <span class="jxr_string">"foobar"</span>,
+<a name="288" href="#288">288</a> <span class="jxr_string">"urn:foo.bar"</span>,
+<a name="289" href="#289">289</a> <span class="jxr_string">""</span>);
+<a name="290" href="#290">290</a> parts.add(encP2);
+<a name="291" href="#291">291</a> encrypt.setParts(parts);
<a name="292" href="#292">292</a>
-<a name="293" href="#293">293</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="294" href="#294">294</a> String outputString =
-<a name="295" href="#295">295</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="296" href="#296">296</a> LOG.debug(outputString);
-<a name="297" href="#297">297</a> }
-<a name="298" href="#298">298</a>
-<a name="299" href="#299">299</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="293" href="#293">293</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="294" href="#294">294</a>
+<a name="295" href="#295">295</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="296" href="#296">296</a> String outputString =
+<a name="297" href="#297">297</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="298" href="#298">298</a> LOG.debug(outputString);
+<a name="299" href="#299">299</a> }
<a name="300" href="#300">300</a>
-<a name="301" href="#301">301</a> QName fooName = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar"</span>);
-<a name="302" href="#302">302</a> QName bodyName = <strong class="jxr_keyword">new</strong> QName(soapConstants.getEnvelopeURI(), <span class="jxr_string">"Body"</span>);
-<a name="303" href="#303">303</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{fooName});
-<a name="304" href="#304">304</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{bodyName});
-<a name="305" href="#305">305</a> WSSecurityUtil.checkAllElementsProtected(
-<a name="306" href="#306">306</a> results,
-<a name="307" href="#307">307</a> WSConstants.ENCR,
-<a name="308" href="#308">308</a> <strong class="jxr_keyword">new</strong> QName[]{bodyName, fooName}
-<a name="309" href="#309">309</a> );
-<a name="310" href="#310">310</a> WSSecurityUtil.checkAllElementsProtected(
-<a name="311" href="#311">311</a> results,
-<a name="312" href="#312">312</a> WSConstants.ENCR,
-<a name="313" href="#313">313</a> <strong class="jxr_keyword">new</strong> QName[]{fooName, bodyName}
-<a name="314" href="#314">314</a> );
-<a name="315" href="#315">315</a> <strong class="jxr_keyword">try</strong> {
-<a name="316" href="#316">316</a> WSSecurityUtil.checkAllElementsProtected(
-<a name="317" href="#317">317</a> results,
-<a name="318" href="#318">318</a> WSConstants.SIGN,
-<a name="319" href="#319">319</a> <strong class="jxr_keyword">new</strong> QName[]{fooName, bodyName}
-<a name="320" href="#320">320</a> );
-<a name="321" href="#321">321</a> fail(<span class="jxr_string">"Failure expected on a wrong action"</span>);
-<a name="322" href="#322">322</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="323" href="#323">323</a> <em class="jxr_comment">// expected</em>
-<a name="324" href="#324">324</a> }
-<a name="325" href="#325">325</a> <strong class="jxr_keyword">try</strong> {
-<a name="326" href="#326">326</a> QName headerName = <strong class="jxr_keyword">new</strong> QName(soapConstants.getEnvelopeURI(), <span class="jxr_string">"Header"</span>);
-<a name="327" href="#327">327</a> WSSecurityUtil.checkAllElementsProtected(
-<a name="328" href="#328">328</a> results,
-<a name="329" href="#329">329</a> WSConstants.ENCR,
-<a name="330" href="#330">330</a> <strong class="jxr_keyword">new</strong> QName[]{fooName, bodyName, headerName}
-<a name="331" href="#331">331</a> );
-<a name="332" href="#332">332</a> fail(<span class="jxr_string">"Failure expected on an unsatisfied requirement"</span>);
-<a name="333" href="#333">333</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
-<a name="334" href="#334">334</a> <em class="jxr_comment">// expected</em>
-<a name="335" href="#335">335</a> }
-<a name="336" href="#336">336</a> }
-<a name="337" href="#337">337</a>
-<a name="338" href="#338">338</a>
-<a name="339" href="#339">339</a> <em class="jxr_javadoccomment">/**</em>
-<a name="340" href="#340">340</a> <em class="jxr_javadoccomment"> * Test getting a DOM Element from WSEncryptionPart directly</em>
-<a name="341" href="#341">341</a> <em class="jxr_javadoccomment"> */</em>
-<a name="342" href="#342">342</a> @org.junit.Test
-<a name="343" href="#343">343</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testEncryptionPartDOMElement() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="344" href="#344">344</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
-<a name="345" href="#345">345</a> SOAPConstants soapConstants =
-<a name="346" href="#346">346</a> WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
-<a name="347" href="#347">347</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="348" href="#348">348</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="349" href="#349">349</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="350" href="#350">350</a>
-<a name="351" href="#351">351</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="352" href="#352">352</a> secHeader.insertSecurityHeader(doc);
-<a name="353" href="#353">353</a>
-<a name="354" href="#354">354</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="355" href="#355">355</a> <em class="jxr_comment">// Give wrong names to make sure it's picking up the element</em>
-<a name="356" href="#356">356</a> WSEncryptionPart encP =
-<a name="357" href="#357">357</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="358" href="#358">358</a> <span class="jxr_string">"Incorrect Localname"</span>,
-<a name="359" href="#359">359</a> <span class="jxr_string">"Incorrect N/S"</span>,
-<a name="360" href="#360">360</a> <span class="jxr_string">""</span>);
-<a name="361" href="#361">361</a> Element bodyElement = WSSecurityUtil.findBodyElement(doc);
-<a name="362" href="#362">362</a> assert bodyElement != <strong class="jxr_keyword">null</strong> && <span class="jxr_string">"Body"</span>.equals(bodyElement.getLocalName());
-<a name="363" href="#363">363</a> encP.setElement(bodyElement);
-<a name="364" href="#364">364</a> parts.add(encP);
-<a name="365" href="#365">365</a> encrypt.setParts(parts);
-<a name="366" href="#366">366</a>
-<a name="367" href="#367">367</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="301" href="#301">301</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="302" href="#302">302</a>
+<a name="303" href="#303">303</a> QName fooName = <strong class="jxr_keyword">new</strong> QName(<span class="jxr_string">"urn:foo.bar"</span>, <span class="jxr_string">"foobar"</span>);
+<a name="304" href="#304">304</a> QName bodyName = <strong class="jxr_keyword">new</strong> QName(soapConstants.getEnvelopeURI(), <span class="jxr_string">"Body"</span>);
+<a name="305" href="#305">305</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{fooName});
+<a name="306" href="#306">306</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{bodyName});
+<a name="307" href="#307">307</a> WSSecurityUtil.checkAllElementsProtected(
+<a name="308" href="#308">308</a> results,
+<a name="309" href="#309">309</a> WSConstants.ENCR,
+<a name="310" href="#310">310</a> <strong class="jxr_keyword">new</strong> QName[]{bodyName, fooName}
+<a name="311" href="#311">311</a> );
+<a name="312" href="#312">312</a> WSSecurityUtil.checkAllElementsProtected(
+<a name="313" href="#313">313</a> results,
+<a name="314" href="#314">314</a> WSConstants.ENCR,
+<a name="315" href="#315">315</a> <strong class="jxr_keyword">new</strong> QName[]{fooName, bodyName}
+<a name="316" href="#316">316</a> );
+<a name="317" href="#317">317</a> <strong class="jxr_keyword">try</strong> {
+<a name="318" href="#318">318</a> WSSecurityUtil.checkAllElementsProtected(
+<a name="319" href="#319">319</a> results,
+<a name="320" href="#320">320</a> WSConstants.SIGN,
+<a name="321" href="#321">321</a> <strong class="jxr_keyword">new</strong> QName[]{fooName, bodyName}
+<a name="322" href="#322">322</a> );
+<a name="323" href="#323">323</a> fail(<span class="jxr_string">"Failure expected on a wrong action"</span>);
+<a name="324" href="#324">324</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="325" href="#325">325</a> <em class="jxr_comment">// expected</em>
+<a name="326" href="#326">326</a> }
+<a name="327" href="#327">327</a> <strong class="jxr_keyword">try</strong> {
+<a name="328" href="#328">328</a> QName headerName = <strong class="jxr_keyword">new</strong> QName(soapConstants.getEnvelopeURI(), <span class="jxr_string">"Header"</span>);
+<a name="329" href="#329">329</a> WSSecurityUtil.checkAllElementsProtected(
+<a name="330" href="#330">330</a> results,
+<a name="331" href="#331">331</a> WSConstants.ENCR,
+<a name="332" href="#332">332</a> <strong class="jxr_keyword">new</strong> QName[]{fooName, bodyName, headerName}
+<a name="333" href="#333">333</a> );
+<a name="334" href="#334">334</a> fail(<span class="jxr_string">"Failure expected on an unsatisfied requirement"</span>);
+<a name="335" href="#335">335</a> } <strong class="jxr_keyword">catch</strong> (WSSecurityException ex) {
+<a name="336" href="#336">336</a> <em class="jxr_comment">// expected</em>
+<a name="337" href="#337">337</a> }
+<a name="338" href="#338">338</a> }
+<a name="339" href="#339">339</a>
+<a name="340" href="#340">340</a>
+<a name="341" href="#341">341</a> <em class="jxr_javadoccomment">/**</em>
+<a name="342" href="#342">342</a> <em class="jxr_javadoccomment"> * Test getting a DOM Element from WSEncryptionPart directly</em>
+<a name="343" href="#343">343</a> <em class="jxr_javadoccomment"> */</em>
+<a name="344" href="#344">344</a> @org.junit.Test
+<a name="345" href="#345">345</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testEncryptionPartDOMElement() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="346" href="#346">346</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
+<a name="347" href="#347">347</a> SOAPConstants soapConstants =
+<a name="348" href="#348">348</a> WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
+<a name="349" href="#349">349</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="350" href="#350">350</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="351" href="#351">351</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
+<a name="352" href="#352">352</a>
+<a name="353" href="#353">353</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="354" href="#354">354</a> secHeader.insertSecurityHeader(doc);
+<a name="355" href="#355">355</a>
+<a name="356" href="#356">356</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="357" href="#357">357</a> <em class="jxr_comment">// Give wrong names to make sure it's picking up the element</em>
+<a name="358" href="#358">358</a> WSEncryptionPart encP =
+<a name="359" href="#359">359</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="360" href="#360">360</a> <span class="jxr_string">"Incorrect Localname"</span>,
+<a name="361" href="#361">361</a> <span class="jxr_string">"Incorrect N/S"</span>,
+<a name="362" href="#362">362</a> <span class="jxr_string">""</span>);
+<a name="363" href="#363">363</a> Element bodyElement = WSSecurityUtil.findBodyElement(doc);
+<a name="364" href="#364">364</a> assert bodyElement != <strong class="jxr_keyword">null</strong> && <span class="jxr_string">"Body"</span>.equals(bodyElement.getLocalName());
+<a name="365" href="#365">365</a> encP.setElement(bodyElement);
+<a name="366" href="#366">366</a> parts.add(encP);
+<a name="367" href="#367">367</a> encrypt.setParts(parts);
<a name="368" href="#368">368</a>
-<a name="369" href="#369">369</a> String outputString =
-<a name="370" href="#370">370</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="371" href="#371">371</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="372" href="#372">372</a> LOG.debug(outputString);
-<a name="373" href="#373">373</a> }
-<a name="374" href="#374">374</a> assertTrue (!outputString.contains(<span class="jxr_string">"testMethod"</span>));
-<a name="375" href="#375">375</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
-<a name="376" href="#376">376</a>
-<a name="377" href="#377">377</a> QName bodyName = <strong class="jxr_keyword">new</strong> QName(soapConstants.getEnvelopeURI(), <span class="jxr_string">"Body"</span>);
-<a name="378" href="#378">378</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{bodyName});
-<a name="379" href="#379">379</a> }
-<a name="380" href="#380">380</a>
-<a name="381" href="#381">381</a> <em class="jxr_javadoccomment">/**</em>
-<a name="382" href="#382">382</a> <em class="jxr_javadoccomment"> * Test encrypting two SOAP Body elements with the same QName.</em>
-<a name="383" href="#383">383</a> <em class="jxr_javadoccomment"> */</em>
-<a name="384" href="#384">384</a> @org.junit.Test
-<a name="385" href="#385">385</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testMultipleElements() <strong class="jxr_keyword">throws</strong> Exception {
-<a name="386" href="#386">386</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG_MULTIPLE);
-<a name="387" href="#387">387</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
-<a name="388" href="#388">388</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
-<a name="389" href="#389">389</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-<a name="390" href="#390">390</a>
-<a name="391" href="#391">391</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
-<a name="392" href="#392">392</a> secHeader.insertSecurityHeader(doc);
-<a name="393" href="#393">393</a>
-<a name="394" href="#394">394</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
-<a name="395" href="#395">395</a> WSEncryptionPart encP =
-<a name="396" href="#396">396</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
-<a name="397" href="#397">397</a> <span class="jxr_string">"testMethod"</span>,
-<a name="398" href="#398">398</a> <span class="jxr_string">"http://axis/service/security/test6/LogTestService8"</span>,
-<a name="399" href="#399">399</a> <span class="jxr_string">""</span>);
-<a name="400" href="#400">400</a> parts.add(encP);
-<a name="401" href="#401">401</a> encrypt.setParts(parts);
-<a name="402" href="#402">402</a>
-<a name="403" href="#403">403</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="369" href="#369">369</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="370" href="#370">370</a>
+<a name="371" href="#371">371</a> String outputString =
+<a name="372" href="#372">372</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="373" href="#373">373</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="374" href="#374">374</a> LOG.debug(outputString);
+<a name="375" href="#375">375</a> }
+<a name="376" href="#376">376</a> assertTrue (!outputString.contains(<span class="jxr_string">"testMethod"</span>));
+<a name="377" href="#377">377</a> List<WSSecurityEngineResult> results = verify(encryptedDoc);
+<a name="378" href="#378">378</a>
+<a name="379" href="#379">379</a> QName bodyName = <strong class="jxr_keyword">new</strong> QName(soapConstants.getEnvelopeURI(), <span class="jxr_string">"Body"</span>);
+<a name="380" href="#380">380</a> WSSecurityUtil.checkAllElementsProtected(results, WSConstants.ENCR, <strong class="jxr_keyword">new</strong> QName[]{bodyName});
+<a name="381" href="#381">381</a> }
+<a name="382" href="#382">382</a>
+<a name="383" href="#383">383</a> <em class="jxr_javadoccomment">/**</em>
+<a name="384" href="#384">384</a> <em class="jxr_javadoccomment"> * Test encrypting two SOAP Body elements with the same QName.</em>
+<a name="385" href="#385">385</a> <em class="jxr_javadoccomment"> */</em>
+<a name="386" href="#386">386</a> @org.junit.Test
+<a name="387" href="#387">387</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testMultipleElements() <strong class="jxr_keyword">throws</strong> Exception {
+<a name="388" href="#388">388</a> Document doc = SOAPUtil.toSOAPPart(SOAPMSG_MULTIPLE);
+<a name="389" href="#389">389</a> WSSecEncrypt encrypt = <strong class="jxr_keyword">new</strong> WSSecEncrypt();
+<a name="390" href="#390">390</a> encrypt.setUserInfo(<span class="jxr_string">"16c73ab6-b892-458f-abf5-2f875f74882e"</span>, <span class="jxr_string">"security"</span>);
+<a name="391" href="#391">391</a> encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
+<a name="392" href="#392">392</a>
+<a name="393" href="#393">393</a> WSSecHeader secHeader = <strong class="jxr_keyword">new</strong> WSSecHeader();
+<a name="394" href="#394">394</a> secHeader.insertSecurityHeader(doc);
+<a name="395" href="#395">395</a>
+<a name="396" href="#396">396</a> List<WSEncryptionPart> parts = <strong class="jxr_keyword">new</strong> ArrayList<WSEncryptionPart>();
+<a name="397" href="#397">397</a> WSEncryptionPart encP =
+<a name="398" href="#398">398</a> <strong class="jxr_keyword">new</strong> WSEncryptionPart(
+<a name="399" href="#399">399</a> <span class="jxr_string">"testMethod"</span>,
+<a name="400" href="#400">400</a> <span class="jxr_string">"http://axis/service/security/test6/LogTestService8"</span>,
+<a name="401" href="#401">401</a> <span class="jxr_string">""</span>);
+<a name="402" href="#402">402</a> parts.add(encP);
+<a name="403" href="#403">403</a> encrypt.setParts(parts);
<a name="404" href="#404">404</a>
-<a name="405" href="#405">405</a> String outputString =
-<a name="406" href="#406">406</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="407" href="#407">407</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="408" href="#408">408</a> LOG.debug(outputString);
-<a name="409" href="#409">409</a> }
-<a name="410" href="#410">410</a> assert !outputString.contains(<span class="jxr_string">"testMethod"</span>);
-<a name="411" href="#411">411</a>
-<a name="412" href="#412">412</a> verify(encryptedDoc);
+<a name="405" href="#405">405</a> Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+<a name="406" href="#406">406</a>
+<a name="407" href="#407">407</a> String outputString =
+<a name="408" href="#408">408</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="409" href="#409">409</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="410" href="#410">410</a> LOG.debug(outputString);
+<a name="411" href="#411">411</a> }
+<a name="412" href="#412">412</a> assert !outputString.contains(<span class="jxr_string">"testMethod"</span>);
<a name="413" href="#413">413</a>
-<a name="414" href="#414">414</a> outputString =
-<a name="415" href="#415">415</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
-<a name="416" href="#416">416</a> assert outputString.contains(<span class="jxr_string">"asf1"</span>);
-<a name="417" href="#417">417</a> assert outputString.contains(<span class="jxr_string">"asf2"</span>);
-<a name="418" href="#418">418</a> }
-<a name="419" href="#419">419</a>
-<a name="420" href="#420">420</a>
-<a name="421" href="#421">421</a> <em class="jxr_javadoccomment">/**</em>
-<a name="422" href="#422">422</a> <em class="jxr_javadoccomment"> * Verifies the soap envelope</em>
-<a name="423" href="#423">423</a> <em class="jxr_javadoccomment"> * <p/></em>
-<a name="424" href="#424">424</a> <em class="jxr_javadoccomment"> * </em>
-<a name="425" href="#425">425</a> <em class="jxr_javadoccomment"> * @param doc </em>
-<a name="426" href="#426">426</a> <em class="jxr_javadoccomment"> * @throws Exception Thrown when there is a problem in verification</em>
-<a name="427" href="#427">427</a> <em class="jxr_javadoccomment"> */</em>
-<a name="428" href="#428">428</a> <strong class="jxr_keyword">private</strong> List<WSSecurityEngineResult> verify(Document doc) <strong class="jxr_keyword">throws</strong> Exception {
-<a name="429" href="#429">429</a> List<WSSecurityEngineResult> results =
-<a name="430" href="#430">430</a> secEngine.processSecurityHeader(doc, <strong class="jxr_keyword">null</strong>, callbackHandler, <strong class="jxr_keyword">null</strong>, crypto);
-<a name="431" href="#431">431</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="432" href="#432">432</a> LOG.debug(<span class="jxr_string">"Verified and decrypted message:"</span>);
-<a name="433" href="#433">433</a> String outputString =
-<a name="434" href="#434">434</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
-<a name="435" href="#435">435</a> LOG.debug(outputString);
-<a name="436" href="#436">436</a> }
-<a name="437" href="#437">437</a> <strong class="jxr_keyword">return</strong> results;
-<a name="438" href="#438">438</a> }
-<a name="439" href="#439">439</a>
-<a name="440" href="#440">440</a> }
+<a name="414" href="#414">414</a> verify(encryptedDoc);
+<a name="415" href="#415">415</a>
+<a name="416" href="#416">416</a> outputString =
+<a name="417" href="#417">417</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
+<a name="418" href="#418">418</a> assert outputString.contains(<span class="jxr_string">"asf1"</span>);
+<a name="419" href="#419">419</a> assert outputString.contains(<span class="jxr_string">"asf2"</span>);
+<a name="420" href="#420">420</a> }
+<a name="421" href="#421">421</a>
+<a name="422" href="#422">422</a>
+<a name="423" href="#423">423</a> <em class="jxr_javadoccomment">/**</em>
+<a name="424" href="#424">424</a> <em class="jxr_javadoccomment"> * Verifies the soap envelope</em>
+<a name="425" href="#425">425</a> <em class="jxr_javadoccomment"> * <p/></em>
+<a name="426" href="#426">426</a> <em class="jxr_javadoccomment"> * </em>
+<a name="427" href="#427">427</a> <em class="jxr_javadoccomment"> * @param doc </em>
+<a name="428" href="#428">428</a> <em class="jxr_javadoccomment"> * @throws Exception Thrown when there is a problem in verification</em>
+<a name="429" href="#429">429</a> <em class="jxr_javadoccomment"> */</em>
+<a name="430" href="#430">430</a> <strong class="jxr_keyword">private</strong> List<WSSecurityEngineResult> verify(Document doc) <strong class="jxr_keyword">throws</strong> Exception {
+<a name="431" href="#431">431</a> List<WSSecurityEngineResult> results =
+<a name="432" href="#432">432</a> secEngine.processSecurityHeader(doc, <strong class="jxr_keyword">null</strong>, callbackHandler, <strong class="jxr_keyword">null</strong>, crypto);
+<a name="433" href="#433">433</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="434" href="#434">434</a> LOG.debug(<span class="jxr_string">"Verified and decrypted message:"</span>);
+<a name="435" href="#435">435</a> String outputString =
+<a name="436" href="#436">436</a> org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
+<a name="437" href="#437">437</a> LOG.debug(outputString);
+<a name="438" href="#438">438</a> }
+<a name="439" href="#439">439</a> <strong class="jxr_keyword">return</strong> results;
+<a name="440" href="#440">440</a> }
+<a name="441" href="#441">441</a>
+<a name="442" href="#442">442</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>