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 [47/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/org/apache/ws/security/str/EncryptedKeySTRParser.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/str/EncryptedKeySTRParser.html?rev=1133081&r1=1133080&r2=1133081&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/str/EncryptedKeySTRParser.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/str/EncryptedKeySTRParser.html Tue Jun 7 16:25:20 2011
@@ -86,21 +86,21 @@
<a name="76" href="#76">76</a> }
<a name="77" href="#77">77</a>
<a name="78" href="#78">78</a> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a>(strElement, bspCompliant);
-<a name="79" href="#79">79</a> <em class="jxr_comment">//</em>
-<a name="80" href="#80">80</a> <em class="jxr_comment">// Handle X509IssuerSerial here. First check if all elements are available,</em>
-<a name="81" href="#81">81</a> <em class="jxr_comment">// get the appropriate data, check if all data is available.</em>
-<a name="82" href="#82">82</a> <em class="jxr_comment">// Then look up the certificate alias according to issuer name and serial number.</em>
-<a name="83" href="#83">83</a> <em class="jxr_comment">//</em>
-<a name="84" href="#84">84</a> <strong class="jxr_keyword">if</strong> (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {
-<a name="85" href="#85">85</a> certs = secRef.getX509IssuerSerial(crypto);
-<a name="86" href="#86">86</a> }
-<a name="87" href="#87">87</a> <em class="jxr_comment">//</em>
-<a name="88" href="#88">88</a> <em class="jxr_comment">// If wsse:KeyIdentifier found, then the public key of the attached cert was used to</em>
-<a name="89" href="#89">89</a> <em class="jxr_comment">// encrypt the session (symmetric) key that encrypts the data. Extract the certificate</em>
-<a name="90" href="#90">90</a> <em class="jxr_comment">// using the BinarySecurity token (was enhanced to handle KeyIdentifier too).</em>
-<a name="91" href="#91">91</a> <em class="jxr_comment">// This method is _not_ recommended by OASIS WS-S specification, X509 profile</em>
-<a name="92" href="#92">92</a> <em class="jxr_comment">//</em>
-<a name="93" href="#93">93</a> <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
+<a name="79" href="#79">79</a>
+<a name="80" href="#80">80</a> String uri = <strong class="jxr_keyword">null</strong>;
+<a name="81" href="#81">81</a> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
+<a name="82" href="#82">82</a> uri = secRef.getReference().getURI();
+<a name="83" href="#83">83</a> <strong class="jxr_keyword">if</strong> (uri.charAt(0) == '#') {
+<a name="84" href="#84">84</a> uri = uri.substring(1);
+<a name="85" href="#85">85</a> }
+<a name="86" href="#86">86</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
+<a name="87" href="#87">87</a> uri = secRef.getKeyIdentifierValue();
+<a name="88" href="#88">88</a> }
+<a name="89" href="#89">89</a>
+<a name="90" href="#90">90</a> <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result = wsDocInfo.getResult(uri);
+<a name="91" href="#91">91</a> <strong class="jxr_keyword">if</strong> (result != <strong class="jxr_keyword">null</strong>) {
+<a name="92" href="#92">92</a> processPreviousResult(result, secRef, data, wsDocInfo, bspCompliant);
+<a name="93" href="#93">93</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
<a name="94" href="#94">94</a> <strong class="jxr_keyword">if</strong> (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())
<a name="95" href="#95">95</a> || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) {
<a name="96" href="#96">96</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
@@ -120,120 +120,121 @@
<a name="110" href="#110">110</a> }
<a name="111" href="#111">111</a> certs = secRef.getKeyIdentifier(crypto);
<a name="112" href="#112">112</a> }
-<a name="113" href="#113">113</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
-<a name="114" href="#114">114</a> <strong class="jxr_keyword">if</strong> (wsDocInfo != <strong class="jxr_keyword">null</strong>) {
-<a name="115" href="#115">115</a> String uri = secRef.getReference().getURI();
-<a name="116" href="#116">116</a> <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result = wsDocInfo.getResult(uri);
-<a name="117" href="#117">117</a>
-<a name="118" href="#118">118</a> <strong class="jxr_keyword">if</strong> (result != <strong class="jxr_keyword">null</strong>) {
-<a name="119" href="#119">119</a> <strong class="jxr_keyword">int</strong> action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
-<a name="120" href="#120">120</a> <strong class="jxr_keyword">if</strong> (WSConstants.BST == action) {
-<a name="121" href="#121">121</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
-<a name="122" href="#122">122</a> <a href="../../../../../org/apache/ws/security/message/token/BinarySecurity.html">BinarySecurity</a> token =
-<a name="123" href="#123">123</a> (<a href="../../../../../org/apache/ws/security/message/token/BinarySecurity.html">BinarySecurity</a>)result.get(
-<a name="124" href="#124">124</a> WSSecurityEngineResult.TAG_BINARY_SECURITY_TOKEN
-<a name="125" href="#125">125</a> );
-<a name="126" href="#126">126</a> BSPEnforcer.checkBinarySecurityBSPCompliance(secRef, token);
-<a name="127" href="#127">127</a> }
-<a name="128" href="#128">128</a> certs =
-<a name="129" href="#129">129</a> (X509Certificate[])result.get(
-<a name="130" href="#130">130</a> WSSecurityEngineResult.TAG_X509_CERTIFICATES
-<a name="131" href="#131">131</a> );
-<a name="132" href="#132">132</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.ST_UNSIGNED == action || WSConstants.ST_SIGNED == action) {
-<a name="133" href="#133">133</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
-<a name="134" href="#134">134</a> (<a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a>)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
-<a name="135" href="#135">135</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
-<a name="136" href="#136">136</a> BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion);
-<a name="137" href="#137">137</a> }
-<a name="138" href="#138">138</a> <a href="../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> keyInfo =
-<a name="139" href="#139">139</a> SAMLUtil.getCredentialFromSubject(assertion,
-<a name="140" href="#140">140</a> data,
-<a name="141" href="#141">141</a> wsDocInfo, bspCompliant);
-<a name="142" href="#142">142</a> certs = keyInfo.getCerts();
-<a name="143" href="#143">143</a> } <strong class="jxr_keyword">else</strong> {
-<a name="144" href="#144">144</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="145" href="#145">145</a> WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
-<a name="146" href="#146">146</a> <span class="jxr_string">"unsupportedBinaryTokenType"</span>,
-<a name="147" href="#147">147</a> <strong class="jxr_keyword">null</strong>
-<a name="148" href="#148">148</a> );
-<a name="149" href="#149">149</a> }
-<a name="150" href="#150">150</a> }
-<a name="151" href="#151">151</a> }
-<a name="152" href="#152">152</a> <strong class="jxr_keyword">if</strong> (certs == <strong class="jxr_keyword">null</strong>) {
-<a name="153" href="#153">153</a> Element bstElement =
-<a name="154" href="#154">154</a> secRef.getTokenElement(strElement.getOwnerDocument(), wsDocInfo, data.getCallbackHandler());
-<a name="155" href="#155">155</a>
-<a name="156" href="#156">156</a> <em class="jxr_comment">// at this point ... check token type: Binary</em>
-<a name="157" href="#157">157</a> QName el = <strong class="jxr_keyword">new</strong> QName(bstElement.getNamespaceURI(), bstElement.getLocalName());
-<a name="158" href="#158">158</a> <strong class="jxr_keyword">if</strong> (el.equals(WSSecurityEngine.BINARY_TOKEN)) {
-<a name="159" href="#159">159</a> X509Security token = <strong class="jxr_keyword">new</strong> X509Security(bstElement);
-<a name="160" href="#160">160</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
-<a name="161" href="#161">161</a> BSPEnforcer.checkBinarySecurityBSPCompliance(secRef, token);
-<a name="162" href="#162">162</a> }
-<a name="163" href="#163">163</a> certs = <strong class="jxr_keyword">new</strong> X509Certificate[]{token.getX509Certificate(crypto)};
-<a name="164" href="#164">164</a> } <strong class="jxr_keyword">else</strong> {
-<a name="165" href="#165">165</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="166" href="#166">166</a> WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
-<a name="167" href="#167">167</a> <span class="jxr_string">"unsupportedBinaryTokenType"</span>,
-<a name="168" href="#168">168</a> <strong class="jxr_keyword">null</strong>
-<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> } <strong class="jxr_keyword">else</strong> {
-<a name="173" href="#173">173</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="174" href="#174">174</a> WSSecurityException.INVALID_SECURITY, <span class="jxr_string">"unsupportedKeyId"</span>
-<a name="175" href="#175">175</a> );
-<a name="176" href="#176">176</a> }
-<a name="177" href="#177">177</a>
-<a name="178" href="#178">178</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled() && certs != <strong class="jxr_keyword">null</strong> && certs[0] != <strong class="jxr_keyword">null</strong>) {
-<a name="179" href="#179">179</a> LOG.debug(<span class="jxr_string">"cert: "</span> + certs[0]);
-<a name="180" href="#180">180</a> }
-<a name="181" href="#181">181</a> }
-<a name="182" href="#182">182</a>
-<a name="183" href="#183">183</a> <em class="jxr_javadoccomment">/**</em>
-<a name="184" href="#184">184</a> <em class="jxr_javadoccomment"> * Get the X509Certificates associated with this SecurityTokenReference</em>
-<a name="185" href="#185">185</a> <em class="jxr_javadoccomment"> * @return the X509Certificates associated with this SecurityTokenReference</em>
+<a name="113" href="#113">113</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {
+<a name="114" href="#114">114</a> certs = secRef.getX509IssuerSerial(crypto);
+<a name="115" href="#115">115</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
+<a name="116" href="#116">116</a> Element bstElement =
+<a name="117" href="#117">117</a> secRef.getTokenElement(strElement.getOwnerDocument(), wsDocInfo, data.getCallbackHandler());
+<a name="118" href="#118">118</a>
+<a name="119" href="#119">119</a> <em class="jxr_comment">// at this point ... check token type: Binary</em>
+<a name="120" href="#120">120</a> QName el = <strong class="jxr_keyword">new</strong> QName(bstElement.getNamespaceURI(), bstElement.getLocalName());
+<a name="121" href="#121">121</a> <strong class="jxr_keyword">if</strong> (el.equals(WSSecurityEngine.BINARY_TOKEN)) {
+<a name="122" href="#122">122</a> X509Security token = <strong class="jxr_keyword">new</strong> X509Security(bstElement);
+<a name="123" href="#123">123</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
+<a name="124" href="#124">124</a> BSPEnforcer.checkBinarySecurityBSPCompliance(secRef, token);
+<a name="125" href="#125">125</a> }
+<a name="126" href="#126">126</a> certs = <strong class="jxr_keyword">new</strong> X509Certificate[]{token.getX509Certificate(crypto)};
+<a name="127" href="#127">127</a> } <strong class="jxr_keyword">else</strong> {
+<a name="128" href="#128">128</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="129" href="#129">129</a> WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
+<a name="130" href="#130">130</a> <span class="jxr_string">"unsupportedBinaryTokenType"</span>,
+<a name="131" href="#131">131</a> <strong class="jxr_keyword">null</strong>
+<a name="132" href="#132">132</a> );
+<a name="133" href="#133">133</a> }
+<a name="134" href="#134">134</a> }
+<a name="135" href="#135">135</a>
+<a name="136" href="#136">136</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled() && certs != <strong class="jxr_keyword">null</strong> && certs[0] != <strong class="jxr_keyword">null</strong>) {
+<a name="137" href="#137">137</a> LOG.debug(<span class="jxr_string">"cert: "</span> + certs[0]);
+<a name="138" href="#138">138</a> }
+<a name="139" href="#139">139</a> }
+<a name="140" href="#140">140</a>
+<a name="141" href="#141">141</a> <em class="jxr_javadoccomment">/**</em>
+<a name="142" href="#142">142</a> <em class="jxr_javadoccomment"> * Get the X509Certificates associated with this SecurityTokenReference</em>
+<a name="143" href="#143">143</a> <em class="jxr_javadoccomment"> * @return the X509Certificates associated with this SecurityTokenReference</em>
+<a name="144" href="#144">144</a> <em class="jxr_javadoccomment"> */</em>
+<a name="145" href="#145">145</a> <strong class="jxr_keyword">public</strong> X509Certificate[] getCertificates() {
+<a name="146" href="#146">146</a> <strong class="jxr_keyword">return</strong> certs;
+<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"> * Get the Principal associated with this SecurityTokenReference</em>
+<a name="151" href="#151">151</a> <em class="jxr_javadoccomment"> * @return the Principal associated with this SecurityTokenReference</em>
+<a name="152" href="#152">152</a> <em class="jxr_javadoccomment"> */</em>
+<a name="153" href="#153">153</a> <strong class="jxr_keyword">public</strong> Principal getPrincipal() {
+<a name="154" href="#154">154</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="155" href="#155">155</a> }
+<a name="156" href="#156">156</a>
+<a name="157" href="#157">157</a> <em class="jxr_javadoccomment">/**</em>
+<a name="158" href="#158">158</a> <em class="jxr_javadoccomment"> * Get the PublicKey associated with this SecurityTokenReference</em>
+<a name="159" href="#159">159</a> <em class="jxr_javadoccomment"> * @return the PublicKey associated with this SecurityTokenReference</em>
+<a name="160" href="#160">160</a> <em class="jxr_javadoccomment"> */</em>
+<a name="161" href="#161">161</a> <strong class="jxr_keyword">public</strong> PublicKey getPublicKey() {
+<a name="162" href="#162">162</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="163" href="#163">163</a> }
+<a name="164" href="#164">164</a>
+<a name="165" href="#165">165</a> <em class="jxr_javadoccomment">/**</em>
+<a name="166" href="#166">166</a> <em class="jxr_javadoccomment"> * Get the Secret Key associated with this SecurityTokenReference</em>
+<a name="167" href="#167">167</a> <em class="jxr_javadoccomment"> * @return the Secret Key associated with this SecurityTokenReference</em>
+<a name="168" href="#168">168</a> <em class="jxr_javadoccomment"> */</em>
+<a name="169" href="#169">169</a> <strong class="jxr_keyword">public</strong> byte[] getSecretKey() {
+<a name="170" href="#170">170</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<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"> * Get whether the returned credential is already trusted or not. This is currently</em>
+<a name="175" href="#175">175</a> <em class="jxr_javadoccomment"> * applicable in the case of a credential extracted from a trusted HOK SAML Assertion,</em>
+<a name="176" href="#176">176</a> <em class="jxr_javadoccomment"> * and a BinarySecurityToken that has been processed by a Validator. In these cases,</em>
+<a name="177" href="#177">177</a> <em class="jxr_javadoccomment"> * the SignatureProcessor does not need to verify trust on the credential.</em>
+<a name="178" href="#178">178</a> <em class="jxr_javadoccomment"> * @return true if trust has already been verified on the returned Credential</em>
+<a name="179" href="#179">179</a> <em class="jxr_javadoccomment"> */</em>
+<a name="180" href="#180">180</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isTrustedCredential() {
+<a name="181" href="#181">181</a> <strong class="jxr_keyword">return</strong> false;
+<a name="182" href="#182">182</a> }
+<a name="183" href="#183">183</a>
+<a name="184" href="#184">184</a> <em class="jxr_javadoccomment">/**</em>
+<a name="185" href="#185">185</a> <em class="jxr_javadoccomment"> * Process a previous security result</em>
<a name="186" href="#186">186</a> <em class="jxr_javadoccomment"> */</em>
-<a name="187" href="#187">187</a> <strong class="jxr_keyword">public</strong> X509Certificate[] getCertificates() {
-<a name="188" href="#188">188</a> <strong class="jxr_keyword">return</strong> certs;
-<a name="189" href="#189">189</a> }
-<a name="190" href="#190">190</a>
-<a name="191" href="#191">191</a> <em class="jxr_javadoccomment">/**</em>
-<a name="192" href="#192">192</a> <em class="jxr_javadoccomment"> * Get the Principal associated with this SecurityTokenReference</em>
-<a name="193" href="#193">193</a> <em class="jxr_javadoccomment"> * @return the Principal associated with this SecurityTokenReference</em>
-<a name="194" href="#194">194</a> <em class="jxr_javadoccomment"> */</em>
-<a name="195" href="#195">195</a> <strong class="jxr_keyword">public</strong> Principal getPrincipal() {
-<a name="196" href="#196">196</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<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"> * Get the PublicKey associated with this SecurityTokenReference</em>
-<a name="201" href="#201">201</a> <em class="jxr_javadoccomment"> * @return the PublicKey associated with this SecurityTokenReference</em>
-<a name="202" href="#202">202</a> <em class="jxr_javadoccomment"> */</em>
-<a name="203" href="#203">203</a> <strong class="jxr_keyword">public</strong> PublicKey getPublicKey() {
-<a name="204" href="#204">204</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="205" href="#205">205</a> }
-<a name="206" href="#206">206</a>
-<a name="207" href="#207">207</a> <em class="jxr_javadoccomment">/**</em>
-<a name="208" href="#208">208</a> <em class="jxr_javadoccomment"> * Get the Secret Key associated with this SecurityTokenReference</em>
-<a name="209" href="#209">209</a> <em class="jxr_javadoccomment"> * @return the Secret Key associated with this SecurityTokenReference</em>
-<a name="210" href="#210">210</a> <em class="jxr_javadoccomment"> */</em>
-<a name="211" href="#211">211</a> <strong class="jxr_keyword">public</strong> byte[] getSecretKey() {
-<a name="212" href="#212">212</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="213" href="#213">213</a> }
-<a name="214" href="#214">214</a>
-<a name="215" href="#215">215</a> <em class="jxr_javadoccomment">/**</em>
-<a name="216" href="#216">216</a> <em class="jxr_javadoccomment"> * Get whether the returned credential is already trusted or not. This is currently</em>
-<a name="217" href="#217">217</a> <em class="jxr_javadoccomment"> * applicable in the case of a credential extracted from a trusted HOK SAML Assertion,</em>
-<a name="218" href="#218">218</a> <em class="jxr_javadoccomment"> * and a BinarySecurityToken that has been processed by a Validator. In these cases,</em>
-<a name="219" href="#219">219</a> <em class="jxr_javadoccomment"> * the SignatureProcessor does not need to verify trust on the credential.</em>
-<a name="220" href="#220">220</a> <em class="jxr_javadoccomment"> * @return true if trust has already been verified on the returned Credential</em>
-<a name="221" href="#221">221</a> <em class="jxr_javadoccomment"> */</em>
-<a name="222" href="#222">222</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isTrustedCredential() {
-<a name="223" href="#223">223</a> <strong class="jxr_keyword">return</strong> false;
-<a name="224" href="#224">224</a> }
-<a name="225" href="#225">225</a>
-<a name="226" href="#226">226</a> }
+<a name="187" href="#187">187</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> processPreviousResult(
+<a name="188" href="#188">188</a> <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result,
+<a name="189" href="#189">189</a> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef,
+<a name="190" href="#190">190</a> <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data,
+<a name="191" href="#191">191</a> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> wsDocInfo,
+<a name="192" href="#192">192</a> <strong class="jxr_keyword">boolean</strong> bspCompliant
+<a name="193" href="#193">193</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="194" href="#194">194</a> <strong class="jxr_keyword">int</strong> action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
+<a name="195" href="#195">195</a> <strong class="jxr_keyword">if</strong> (WSConstants.BST == action) {
+<a name="196" href="#196">196</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
+<a name="197" href="#197">197</a> <a href="../../../../../org/apache/ws/security/message/token/BinarySecurity.html">BinarySecurity</a> token =
+<a name="198" href="#198">198</a> (<a href="../../../../../org/apache/ws/security/message/token/BinarySecurity.html">BinarySecurity</a>)result.get(
+<a name="199" href="#199">199</a> WSSecurityEngineResult.TAG_BINARY_SECURITY_TOKEN
+<a name="200" href="#200">200</a> );
+<a name="201" href="#201">201</a> BSPEnforcer.checkBinarySecurityBSPCompliance(secRef, token);
+<a name="202" href="#202">202</a> }
+<a name="203" href="#203">203</a> certs =
+<a name="204" href="#204">204</a> (X509Certificate[])result.get(
+<a name="205" href="#205">205</a> WSSecurityEngineResult.TAG_X509_CERTIFICATES
+<a name="206" href="#206">206</a> );
+<a name="207" href="#207">207</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.ST_UNSIGNED == action || WSConstants.ST_SIGNED == action) {
+<a name="208" href="#208">208</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
+<a name="209" href="#209">209</a> (<a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a>)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
+<a name="210" href="#210">210</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
+<a name="211" href="#211">211</a> BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion);
+<a name="212" href="#212">212</a> }
+<a name="213" href="#213">213</a> <a href="../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> keyInfo =
+<a name="214" href="#214">214</a> SAMLUtil.getCredentialFromSubject(assertion,
+<a name="215" href="#215">215</a> data,
+<a name="216" href="#216">216</a> wsDocInfo, bspCompliant);
+<a name="217" href="#217">217</a> certs = keyInfo.getCerts();
+<a name="218" href="#218">218</a> } <strong class="jxr_keyword">else</strong> {
+<a name="219" href="#219">219</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="220" href="#220">220</a> WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
+<a name="221" href="#221">221</a> <span class="jxr_string">"unsupportedBinaryTokenType"</span>,
+<a name="222" href="#222">222</a> <strong class="jxr_keyword">null</strong>
+<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>
+<a name="227" href="#227">227</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>
Modified: webservices/wss4j/site/xref/org/apache/ws/security/str/SecurityTokenRefSTRParser.html
URL: http://svn.apache.org/viewvc/webservices/wss4j/site/xref/org/apache/ws/security/str/SecurityTokenRefSTRParser.html?rev=1133081&r1=1133080&r2=1133081&view=diff
==============================================================================
--- webservices/wss4j/site/xref/org/apache/ws/security/str/SecurityTokenRefSTRParser.html (original)
+++ webservices/wss4j/site/xref/org/apache/ws/security/str/SecurityTokenRefSTRParser.html Tue Jun 7 16:25:20 2011
@@ -87,164 +87,186 @@
<a name="77" href="#77">77</a> }
<a name="78" href="#78">78</a>
<a name="79" href="#79">79</a> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a>(strElement, bspCompliant);
-<a name="80" href="#80">80</a>
-<a name="81" href="#81">81</a> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
-<a name="82" href="#82">82</a> <a href="../../../../../org/apache/ws/security/message/token/Reference.html">Reference</a> reference = secRef.getReference();
-<a name="83" href="#83">83</a> String uri = reference.getURI();
-<a name="84" href="#84">84</a> String id = uri;
-<a name="85" href="#85">85</a> <strong class="jxr_keyword">if</strong> (id.charAt(0) == '#') {
-<a name="86" href="#86">86</a> id = id.substring(1);
-<a name="87" href="#87">87</a> }
-<a name="88" href="#88">88</a> <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result = wsDocInfo.getResult(id);
-<a name="89" href="#89">89</a> <strong class="jxr_keyword">if</strong> (result != <strong class="jxr_keyword">null</strong>) {
-<a name="90" href="#90">90</a> <strong class="jxr_keyword">int</strong> action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
-<a name="91" href="#91">91</a> <strong class="jxr_keyword">if</strong> (WSConstants.ENCR == action) {
-<a name="92" href="#92">92</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
-<a name="93" href="#93">93</a> BSPEnforcer.checkEncryptedKeyBSPCompliance(secRef);
-<a name="94" href="#94">94</a> }
-<a name="95" href="#95">95</a> secretKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
-<a name="96" href="#96">96</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.DKT == action) {
-<a name="97" href="#97">97</a> <a href="../../../../../org/apache/ws/security/message/token/DerivedKeyToken.html">DerivedKeyToken</a> dkt =
-<a name="98" href="#98">98</a> (<a href="../../../../../org/apache/ws/security/message/token/DerivedKeyToken.html">DerivedKeyToken</a>)result.get(WSSecurityEngineResult.TAG_DERIVED_KEY_TOKEN);
-<a name="99" href="#99">99</a> byte[] secret =
-<a name="100" href="#100">100</a> (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
-<a name="101" href="#101">101</a> String algorithm = (String)parameters.get(SIGNATURE_METHOD);
-<a name="102" href="#102">102</a> secretKey = dkt.deriveKey(WSSecurityUtil.getKeyLength(algorithm), secret);
-<a name="103" href="#103">103</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.ST_UNSIGNED == action || WSConstants.ST_SIGNED == action) {
-<a name="104" href="#104">104</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
-<a name="105" href="#105">105</a> (<a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a>)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
-<a name="106" href="#106">106</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
-<a name="107" href="#107">107</a> BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion);
-<a name="108" href="#108">108</a> }
-<a name="109" href="#109">109</a> <a href="../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> keyInfo =
-<a name="110" href="#110">110</a> SAMLUtil.getCredentialFromSubject(assertion,
-<a name="111" href="#111">111</a> data, wsDocInfo, bspCompliant);
-<a name="112" href="#112">112</a> <em class="jxr_comment">// TODO Handle malformed SAML tokens where they don't have the </em>
-<a name="113" href="#113">113</a> <em class="jxr_comment">// secret in them</em>
-<a name="114" href="#114">114</a> secretKey = keyInfo.getSecret();
-<a name="115" href="#115">115</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.SCT == action) {
-<a name="116" href="#116">116</a> secretKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
-<a name="117" href="#117">117</a> }
-<a name="118" href="#118">118</a> } <strong class="jxr_keyword">else</strong> {
-<a name="119" href="#119">119</a> <em class="jxr_comment">// Try asking the CallbackHandler for the secret key</em>
-<a name="120" href="#120">120</a> secretKey = getSecretKeyFromToken(id, reference.getValueType(), data);
-<a name="121" href="#121">121</a> <strong class="jxr_keyword">if</strong> (secretKey == <strong class="jxr_keyword">null</strong>) {
-<a name="122" href="#122">122</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="123" href="#123">123</a> WSSecurityException.FAILED_CHECK, <span class="jxr_string">"unsupportedKeyId"</span>, <strong class="jxr_keyword">new</strong> Object[]{id}
-<a name="124" href="#124">124</a> );
-<a name="125" href="#125">125</a> }
-<a name="126" href="#126">126</a> }
-<a name="127" href="#127">127</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()){
-<a name="128" href="#128">128</a> String valueType = secRef.getKeyIdentifierValueType();
-<a name="129" href="#129">129</a> <strong class="jxr_keyword">if</strong> (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(valueType)
-<a name="130" href="#130">130</a> || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(valueType)) {
-<a name="131" href="#131">131</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
-<a name="132" href="#132">132</a> SAMLUtil.getAssertionFromKeyIdentifier(
-<a name="133" href="#133">133</a> secRef, strElement,
-<a name="134" href="#134">134</a> data, wsDocInfo
-<a name="135" href="#135">135</a> );
-<a name="136" href="#136">136</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
-<a name="137" href="#137">137</a> BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion);
-<a name="138" href="#138">138</a> }
-<a name="139" href="#139">139</a> <a href="../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> samlKi =
-<a name="140" href="#140">140</a> SAMLUtil.getCredentialFromSubject(assertion,
-<a name="141" href="#141">141</a> data,
-<a name="142" href="#142">142</a> wsDocInfo, bspCompliant);
-<a name="143" href="#143">143</a> <em class="jxr_comment">// TODO Handle malformed SAML tokens where they don't have the </em>
-<a name="144" href="#144">144</a> <em class="jxr_comment">// secret in them</em>
-<a name="145" href="#145">145</a> secretKey = samlKi.getSecret();
-<a name="146" href="#146">146</a> } <strong class="jxr_keyword">else</strong> {
-<a name="147" href="#147">147</a> <strong class="jxr_keyword">if</strong> (bspCompliant && SecurityTokenReference.ENC_KEY_SHA1_URI.equals(valueType)) {
-<a name="148" href="#148">148</a> BSPEnforcer.checkEncryptedKeyBSPCompliance(secRef);
-<a name="149" href="#149">149</a> }
-<a name="150" href="#150">150</a> secretKey =
-<a name="151" href="#151">151</a> getSecretKeyFromToken(
-<a name="152" href="#152">152</a> secRef.getKeyIdentifierValue(), secRef.getKeyIdentifierValueType(),
-<a name="153" href="#153">153</a> data);
-<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> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(WSSecurityException.FAILED_CHECK, <span class="jxr_string">"noReference"</span>);
-<a name="157" href="#157">157</a> }
+<a name="80" href="#80">80</a>
+<a name="81" href="#81">81</a> String uri = <strong class="jxr_keyword">null</strong>;
+<a name="82" href="#82">82</a> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
+<a name="83" href="#83">83</a> uri = secRef.getReference().getURI();
+<a name="84" href="#84">84</a> <strong class="jxr_keyword">if</strong> (uri.charAt(0) == '#') {
+<a name="85" href="#85">85</a> uri = uri.substring(1);
+<a name="86" href="#86">86</a> }
+<a name="87" href="#87">87</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
+<a name="88" href="#88">88</a> uri = secRef.getKeyIdentifierValue();
+<a name="89" href="#89">89</a> }
+<a name="90" href="#90">90</a>
+<a name="91" href="#91">91</a> <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result = wsDocInfo.getResult(uri);
+<a name="92" href="#92">92</a> <strong class="jxr_keyword">if</strong> (result != <strong class="jxr_keyword">null</strong>) {
+<a name="93" href="#93">93</a> processPreviousResult(result, secRef, data, parameters, wsDocInfo, bspCompliant);
+<a name="94" href="#94">94</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsReference()) {
+<a name="95" href="#95">95</a> <a href="../../../../../org/apache/ws/security/message/token/Reference.html">Reference</a> reference = secRef.getReference();
+<a name="96" href="#96">96</a> <em class="jxr_comment">// Try asking the CallbackHandler for the secret key</em>
+<a name="97" href="#97">97</a> secretKey = getSecretKeyFromToken(uri, reference.getValueType(), data);
+<a name="98" href="#98">98</a> <strong class="jxr_keyword">if</strong> (secretKey == <strong class="jxr_keyword">null</strong>) {
+<a name="99" href="#99">99</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="100" href="#100">100</a> WSSecurityException.FAILED_CHECK, <span class="jxr_string">"unsupportedKeyId"</span>, <strong class="jxr_keyword">new</strong> Object[] {uri}
+<a name="101" href="#101">101</a> );
+<a name="102" href="#102">102</a> }
+<a name="103" href="#103">103</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (secRef.containsKeyIdentifier()) {
+<a name="104" href="#104">104</a> String valueType = secRef.getKeyIdentifierValueType();
+<a name="105" href="#105">105</a> <strong class="jxr_keyword">if</strong> (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(valueType)
+<a name="106" href="#106">106</a> || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(valueType)) {
+<a name="107" href="#107">107</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
+<a name="108" href="#108">108</a> SAMLUtil.getAssertionFromKeyIdentifier(
+<a name="109" href="#109">109</a> secRef, strElement,
+<a name="110" href="#110">110</a> data, wsDocInfo
+<a name="111" href="#111">111</a> );
+<a name="112" href="#112">112</a> secretKey =
+<a name="113" href="#113">113</a> getSecretKeyFromAssertion(assertion, secRef, data, wsDocInfo, bspCompliant);
+<a name="114" href="#114">114</a> } <strong class="jxr_keyword">else</strong> {
+<a name="115" href="#115">115</a> <strong class="jxr_keyword">if</strong> (bspCompliant && SecurityTokenReference.ENC_KEY_SHA1_URI.equals(valueType)) {
+<a name="116" href="#116">116</a> BSPEnforcer.checkEncryptedKeyBSPCompliance(secRef);
+<a name="117" href="#117">117</a> }
+<a name="118" href="#118">118</a> secretKey =
+<a name="119" href="#119">119</a> getSecretKeyFromToken(
+<a name="120" href="#120">120</a> secRef.getKeyIdentifierValue(), secRef.getKeyIdentifierValueType(), data
+<a name="121" href="#121">121</a> );
+<a name="122" href="#122">122</a> }
+<a name="123" href="#123">123</a> } <strong class="jxr_keyword">else</strong> {
+<a name="124" href="#124">124</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(WSSecurityException.FAILED_CHECK, <span class="jxr_string">"noReference"</span>);
+<a name="125" href="#125">125</a> }
+<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"> * Get the X509Certificates associated with this SecurityTokenReference</em>
+<a name="130" href="#130">130</a> <em class="jxr_javadoccomment"> * @return the X509Certificates associated with this SecurityTokenReference</em>
+<a name="131" href="#131">131</a> <em class="jxr_javadoccomment"> */</em>
+<a name="132" href="#132">132</a> <strong class="jxr_keyword">public</strong> X509Certificate[] getCertificates() {
+<a name="133" href="#133">133</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="134" href="#134">134</a> }
+<a name="135" href="#135">135</a>
+<a name="136" href="#136">136</a> <em class="jxr_javadoccomment">/**</em>
+<a name="137" href="#137">137</a> <em class="jxr_javadoccomment"> * Get the Principal associated with this SecurityTokenReference</em>
+<a name="138" href="#138">138</a> <em class="jxr_javadoccomment"> * @return the Principal associated with this SecurityTokenReference</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> Principal getPrincipal() {
+<a name="141" href="#141">141</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="142" href="#142">142</a> }
+<a name="143" href="#143">143</a>
+<a name="144" href="#144">144</a> <em class="jxr_javadoccomment">/**</em>
+<a name="145" href="#145">145</a> <em class="jxr_javadoccomment"> * Get the PublicKey associated with this SecurityTokenReference</em>
+<a name="146" href="#146">146</a> <em class="jxr_javadoccomment"> * @return the PublicKey associated with this SecurityTokenReference</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> PublicKey getPublicKey() {
+<a name="149" href="#149">149</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="150" href="#150">150</a> }
+<a name="151" href="#151">151</a>
+<a name="152" href="#152">152</a> <em class="jxr_javadoccomment">/**</em>
+<a name="153" href="#153">153</a> <em class="jxr_javadoccomment"> * Get the Secret Key associated with this SecurityTokenReference</em>
+<a name="154" href="#154">154</a> <em class="jxr_javadoccomment"> * @return the Secret Key associated with this SecurityTokenReference</em>
+<a name="155" href="#155">155</a> <em class="jxr_javadoccomment"> */</em>
+<a name="156" href="#156">156</a> <strong class="jxr_keyword">public</strong> byte[] getSecretKey() {
+<a name="157" href="#157">157</a> <strong class="jxr_keyword">return</strong> secretKey;
<a name="158" href="#158">158</a> }
<a name="159" href="#159">159</a>
<a name="160" href="#160">160</a> <em class="jxr_javadoccomment">/**</em>
-<a name="161" href="#161">161</a> <em class="jxr_javadoccomment"> * Get the X509Certificates associated with this SecurityTokenReference</em>
-<a name="162" href="#162">162</a> <em class="jxr_javadoccomment"> * @return the X509Certificates associated with this SecurityTokenReference</em>
-<a name="163" href="#163">163</a> <em class="jxr_javadoccomment"> */</em>
-<a name="164" href="#164">164</a> <strong class="jxr_keyword">public</strong> X509Certificate[] getCertificates() {
-<a name="165" href="#165">165</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="166" href="#166">166</a> }
-<a name="167" href="#167">167</a>
-<a name="168" href="#168">168</a> <em class="jxr_javadoccomment">/**</em>
-<a name="169" href="#169">169</a> <em class="jxr_javadoccomment"> * Get the Principal associated with this SecurityTokenReference</em>
-<a name="170" href="#170">170</a> <em class="jxr_javadoccomment"> * @return the Principal associated with this SecurityTokenReference</em>
-<a name="171" href="#171">171</a> <em class="jxr_javadoccomment"> */</em>
-<a name="172" href="#172">172</a> <strong class="jxr_keyword">public</strong> Principal getPrincipal() {
-<a name="173" href="#173">173</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="174" href="#174">174</a> }
-<a name="175" href="#175">175</a>
-<a name="176" href="#176">176</a> <em class="jxr_javadoccomment">/**</em>
-<a name="177" href="#177">177</a> <em class="jxr_javadoccomment"> * Get the PublicKey associated with this SecurityTokenReference</em>
-<a name="178" href="#178">178</a> <em class="jxr_javadoccomment"> * @return the PublicKey associated with this SecurityTokenReference</em>
-<a name="179" href="#179">179</a> <em class="jxr_javadoccomment"> */</em>
-<a name="180" href="#180">180</a> <strong class="jxr_keyword">public</strong> PublicKey getPublicKey() {
-<a name="181" href="#181">181</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="182" href="#182">182</a> }
-<a name="183" href="#183">183</a>
-<a name="184" href="#184">184</a> <em class="jxr_javadoccomment">/**</em>
-<a name="185" href="#185">185</a> <em class="jxr_javadoccomment"> * Get the Secret Key associated with this SecurityTokenReference</em>
-<a name="186" href="#186">186</a> <em class="jxr_javadoccomment"> * @return the Secret Key associated with this SecurityTokenReference</em>
-<a name="187" href="#187">187</a> <em class="jxr_javadoccomment"> */</em>
-<a name="188" href="#188">188</a> <strong class="jxr_keyword">public</strong> byte[] getSecretKey() {
-<a name="189" href="#189">189</a> <strong class="jxr_keyword">return</strong> secretKey;
-<a name="190" href="#190">190</a> }
-<a name="191" href="#191">191</a>
-<a name="192" href="#192">192</a> <em class="jxr_javadoccomment">/**</em>
-<a name="193" href="#193">193</a> <em class="jxr_javadoccomment"> * Get whether the returned credential is already trusted or not. This is currently</em>
-<a name="194" href="#194">194</a> <em class="jxr_javadoccomment"> * applicable in the case of a credential extracted from a trusted HOK SAML Assertion,</em>
-<a name="195" href="#195">195</a> <em class="jxr_javadoccomment"> * and a BinarySecurityToken that has been processed by a Validator. In these cases,</em>
-<a name="196" href="#196">196</a> <em class="jxr_javadoccomment"> * the SignatureProcessor does not need to verify trust on the credential.</em>
-<a name="197" href="#197">197</a> <em class="jxr_javadoccomment"> * @return true if trust has already been verified on the returned Credential</em>
-<a name="198" href="#198">198</a> <em class="jxr_javadoccomment"> */</em>
-<a name="199" href="#199">199</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isTrustedCredential() {
-<a name="200" href="#200">200</a> <strong class="jxr_keyword">return</strong> false;
-<a name="201" href="#201">201</a> }
-<a name="202" href="#202">202</a>
-<a name="203" href="#203">203</a> <em class="jxr_javadoccomment">/**</em>
-<a name="204" href="#204">204</a> <em class="jxr_javadoccomment"> * Get the Secret Key from a CallbackHandler</em>
-<a name="205" href="#205">205</a> <em class="jxr_javadoccomment"> * @param id The id of the element</em>
-<a name="206" href="#206">206</a> <em class="jxr_javadoccomment"> * @param type The type of the element (may be null)</em>
-<a name="207" href="#207">207</a> <em class="jxr_javadoccomment"> * @param cb The CallbackHandler object</em>
-<a name="208" href="#208">208</a> <em class="jxr_javadoccomment"> * @return A Secret Key</em>
-<a name="209" href="#209">209</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
-<a name="210" href="#210">210</a> <em class="jxr_javadoccomment"> */</em>
-<a name="211" href="#211">211</a> <strong class="jxr_keyword">private</strong> byte[] getSecretKeyFromToken(
-<a name="212" href="#212">212</a> String id,
-<a name="213" href="#213">213</a> String type,
-<a name="214" href="#214">214</a> <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data
-<a name="215" href="#215">215</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="216" href="#216">216</a> <strong class="jxr_keyword">if</strong> (id.charAt(0) == '#') {
-<a name="217" href="#217">217</a> id = id.substring(1);
-<a name="218" href="#218">218</a> }
-<a name="219" href="#219">219</a> <a href="../../../../../org/apache/ws/security/WSPasswordCallback.html">WSPasswordCallback</a> pwcb =
-<a name="220" href="#220">220</a> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSPasswordCallback.html">WSPasswordCallback</a>(id, <strong class="jxr_keyword">null</strong>, type, WSPasswordCallback.SECRET_KEY, data);
-<a name="221" href="#221">221</a> <strong class="jxr_keyword">try</strong> {
-<a name="222" href="#222">222</a> Callback[] callbacks = <strong class="jxr_keyword">new</strong> Callback[]{pwcb};
-<a name="223" href="#223">223</a> data.getCallbackHandler().handle(callbacks);
-<a name="224" href="#224">224</a> } <strong class="jxr_keyword">catch</strong> (Exception e) {
-<a name="225" href="#225">225</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
-<a name="226" href="#226">226</a> WSSecurityException.FAILURE,
-<a name="227" href="#227">227</a> <span class="jxr_string">"noPassword"</span>,
-<a name="228" href="#228">228</a> <strong class="jxr_keyword">new</strong> Object[] {id},
-<a name="229" href="#229">229</a> e
-<a name="230" href="#230">230</a> );
-<a name="231" href="#231">231</a> }
-<a name="232" href="#232">232</a>
-<a name="233" href="#233">233</a> <strong class="jxr_keyword">return</strong> pwcb.getKey();
-<a name="234" href="#234">234</a> }
-<a name="235" href="#235">235</a>
-<a name="236" href="#236">236</a>
-<a name="237" href="#237">237</a> }
+<a name="161" href="#161">161</a> <em class="jxr_javadoccomment"> * Get whether the returned credential is already trusted or not. This is currently</em>
+<a name="162" href="#162">162</a> <em class="jxr_javadoccomment"> * applicable in the case of a credential extracted from a trusted HOK SAML Assertion,</em>
+<a name="163" href="#163">163</a> <em class="jxr_javadoccomment"> * and a BinarySecurityToken that has been processed by a Validator. In these cases,</em>
+<a name="164" href="#164">164</a> <em class="jxr_javadoccomment"> * the SignatureProcessor does not need to verify trust on the credential.</em>
+<a name="165" href="#165">165</a> <em class="jxr_javadoccomment"> * @return true if trust has already been verified on the returned Credential</em>
+<a name="166" href="#166">166</a> <em class="jxr_javadoccomment"> */</em>
+<a name="167" href="#167">167</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isTrustedCredential() {
+<a name="168" href="#168">168</a> <strong class="jxr_keyword">return</strong> false;
+<a name="169" href="#169">169</a> }
+<a name="170" href="#170">170</a>
+<a name="171" href="#171">171</a> <em class="jxr_javadoccomment">/**</em>
+<a name="172" href="#172">172</a> <em class="jxr_javadoccomment"> * Get the Secret Key from a CallbackHandler</em>
+<a name="173" href="#173">173</a> <em class="jxr_javadoccomment"> * @param id The id of the element</em>
+<a name="174" href="#174">174</a> <em class="jxr_javadoccomment"> * @param type The type of the element (may be null)</em>
+<a name="175" href="#175">175</a> <em class="jxr_javadoccomment"> * @param cb The CallbackHandler object</em>
+<a name="176" href="#176">176</a> <em class="jxr_javadoccomment"> * @return A Secret Key</em>
+<a name="177" href="#177">177</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
+<a name="178" href="#178">178</a> <em class="jxr_javadoccomment"> */</em>
+<a name="179" href="#179">179</a> <strong class="jxr_keyword">private</strong> byte[] getSecretKeyFromToken(
+<a name="180" href="#180">180</a> String id,
+<a name="181" href="#181">181</a> String type,
+<a name="182" href="#182">182</a> <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data
+<a name="183" href="#183">183</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="184" href="#184">184</a> <strong class="jxr_keyword">if</strong> (id.charAt(0) == '#') {
+<a name="185" href="#185">185</a> id = id.substring(1);
+<a name="186" href="#186">186</a> }
+<a name="187" href="#187">187</a> <a href="../../../../../org/apache/ws/security/WSPasswordCallback.html">WSPasswordCallback</a> pwcb =
+<a name="188" href="#188">188</a> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSPasswordCallback.html">WSPasswordCallback</a>(id, <strong class="jxr_keyword">null</strong>, type, WSPasswordCallback.SECRET_KEY, data);
+<a name="189" href="#189">189</a> <strong class="jxr_keyword">try</strong> {
+<a name="190" href="#190">190</a> Callback[] callbacks = <strong class="jxr_keyword">new</strong> Callback[]{pwcb};
+<a name="191" href="#191">191</a> data.getCallbackHandler().handle(callbacks);
+<a name="192" href="#192">192</a> } <strong class="jxr_keyword">catch</strong> (Exception e) {
+<a name="193" href="#193">193</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(
+<a name="194" href="#194">194</a> WSSecurityException.FAILURE,
+<a name="195" href="#195">195</a> <span class="jxr_string">"noPassword"</span>,
+<a name="196" href="#196">196</a> <strong class="jxr_keyword">new</strong> Object[] {id},
+<a name="197" href="#197">197</a> e
+<a name="198" href="#198">198</a> );
+<a name="199" href="#199">199</a> }
+<a name="200" href="#200">200</a>
+<a name="201" href="#201">201</a> <strong class="jxr_keyword">return</strong> pwcb.getKey();
+<a name="202" href="#202">202</a> }
+<a name="203" href="#203">203</a>
+<a name="204" href="#204">204</a> <em class="jxr_javadoccomment">/**</em>
+<a name="205" href="#205">205</a> <em class="jxr_javadoccomment"> * Get a SecretKey from a SAML Assertion</em>
+<a name="206" href="#206">206</a> <em class="jxr_javadoccomment"> */</em>
+<a name="207" href="#207">207</a> <strong class="jxr_keyword">private</strong> byte[] getSecretKeyFromAssertion(
+<a name="208" href="#208">208</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion,
+<a name="209" href="#209">209</a> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef,
+<a name="210" href="#210">210</a> <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data,
+<a name="211" href="#211">211</a> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> wsDocInfo,
+<a name="212" href="#212">212</a> <strong class="jxr_keyword">boolean</strong> bspCompliant
+<a name="213" href="#213">213</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="214" href="#214">214</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
+<a name="215" href="#215">215</a> BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion);
+<a name="216" href="#216">216</a> }
+<a name="217" href="#217">217</a> <a href="../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> samlKi =
+<a name="218" href="#218">218</a> SAMLUtil.getCredentialFromSubject(assertion, data, wsDocInfo, bspCompliant);
+<a name="219" href="#219">219</a> <em class="jxr_comment">// TODO Handle malformed SAML tokens where they don't have the </em>
+<a name="220" href="#220">220</a> <em class="jxr_comment">// secret in them</em>
+<a name="221" href="#221">221</a> <strong class="jxr_keyword">return</strong> samlKi.getSecret();
+<a name="222" href="#222">222</a> }
+<a name="223" href="#223">223</a>
+<a name="224" href="#224">224</a> <em class="jxr_javadoccomment">/**</em>
+<a name="225" href="#225">225</a> <em class="jxr_javadoccomment"> * Process a previous security result</em>
+<a name="226" href="#226">226</a> <em class="jxr_javadoccomment"> */</em>
+<a name="227" href="#227">227</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> processPreviousResult(
+<a name="228" href="#228">228</a> <a href="../../../../../org/apache/ws/security/WSSecurityEngineResult.html">WSSecurityEngineResult</a> result,
+<a name="229" href="#229">229</a> <a href="../../../../../org/apache/ws/security/message/token/SecurityTokenReference.html">SecurityTokenReference</a> secRef,
+<a name="230" href="#230">230</a> <a href="../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data,
+<a name="231" href="#231">231</a> Map<String, Object> parameters,
+<a name="232" href="#232">232</a> <a href="../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> wsDocInfo,
+<a name="233" href="#233">233</a> <strong class="jxr_keyword">boolean</strong> bspCompliant
+<a name="234" href="#234">234</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="235" href="#235">235</a> <strong class="jxr_keyword">int</strong> action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
+<a name="236" href="#236">236</a> <strong class="jxr_keyword">if</strong> (WSConstants.ENCR == action) {
+<a name="237" href="#237">237</a> <strong class="jxr_keyword">if</strong> (bspCompliant) {
+<a name="238" href="#238">238</a> BSPEnforcer.checkEncryptedKeyBSPCompliance(secRef);
+<a name="239" href="#239">239</a> }
+<a name="240" href="#240">240</a> secretKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
+<a name="241" href="#241">241</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.DKT == action) {
+<a name="242" href="#242">242</a> <a href="../../../../../org/apache/ws/security/message/token/DerivedKeyToken.html">DerivedKeyToken</a> dkt =
+<a name="243" href="#243">243</a> (<a href="../../../../../org/apache/ws/security/message/token/DerivedKeyToken.html">DerivedKeyToken</a>)result.get(WSSecurityEngineResult.TAG_DERIVED_KEY_TOKEN);
+<a name="244" href="#244">244</a> byte[] secret =
+<a name="245" href="#245">245</a> (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
+<a name="246" href="#246">246</a> String algorithm = (String)parameters.get(SIGNATURE_METHOD);
+<a name="247" href="#247">247</a> secretKey = dkt.deriveKey(WSSecurityUtil.getKeyLength(algorithm), secret);
+<a name="248" href="#248">248</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.ST_UNSIGNED == action || WSConstants.ST_SIGNED == action) {
+<a name="249" href="#249">249</a> <a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a> assertion =
+<a name="250" href="#250">250</a> (<a href="../../../../../org/apache/ws/security/saml/ext/AssertionWrapper.html">AssertionWrapper</a>)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
+<a name="251" href="#251">251</a> secretKey =
+<a name="252" href="#252">252</a> getSecretKeyFromAssertion(assertion, secRef, data, wsDocInfo, bspCompliant);
+<a name="253" href="#253">253</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (WSConstants.SCT == action) {
+<a name="254" href="#254">254</a> secretKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);
+<a name="255" href="#255">255</a> }
+<a name="256" href="#256">256</a> }
+<a name="257" href="#257">257</a>
+<a name="258" href="#258">258</a>
+<a name="259" href="#259">259</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>