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 2014/01/09 11:30:07 UTC
svn commit: r1556777 [22/23] - in /webservices/website/wss4j: ./ 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/cache/ apidocs/org/apache/w...
Modified: webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/AssertionWrapper.html
URL: http://svn.apache.org/viewvc/webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/AssertionWrapper.html?rev=1556777&r1=1556776&r2=1556777&view=diff
==============================================================================
--- webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/AssertionWrapper.html (original)
+++ webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/AssertionWrapper.html Thu Jan 9 10:29:54 2014
@@ -543,316 +543,322 @@
<a name="533" href="#533">533</a> Signature sig = getSignature();
<a name="534" href="#534">534</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
<a name="535" href="#535">535</a> KeyInfo keyInfo = sig.getKeyInfo();
-<a name="536" href="#536">536</a> <a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> samlKeyInfo =
-<a name="537" href="#537">537</a> SAMLUtil.getCredentialDirectlyFromKeyInfo(keyInfo.getDOM(), data);
-<a name="538" href="#538">538</a> verifySignature(samlKeyInfo);
-<a name="539" href="#539">539</a> } <strong class="jxr_keyword">else</strong> {
-<a name="540" href="#540">540</a> LOG.debug(<span class="jxr_string">"AssertionWrapper: no signature to validate"</span>);
-<a name="541" href="#541">541</a> }
-<a name="542" href="#542">542</a>
-<a name="543" href="#543">543</a> }
-<a name="544" href="#544">544</a>
-<a name="545" href="#545">545</a> <em class="jxr_javadoccomment">/**</em>
-<a name="546" href="#546">546</a> <em class="jxr_javadoccomment"> * Verify the signature of this assertion</em>
-<a name="547" href="#547">547</a> <em class="jxr_javadoccomment"> *</em>
-<a name="548" href="#548">548</a> <em class="jxr_javadoccomment"> * @throws ValidationException</em>
-<a name="549" href="#549">549</a> <em class="jxr_javadoccomment"> */</em>
-<a name="550" href="#550">550</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> verifySignature(<a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> samlKeyInfo) <strong class="jxr_keyword">throws</strong> WSSecurityException {
-<a name="551" href="#551">551</a> Signature sig = getSignature();
-<a name="552" href="#552">552</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
-<a name="553" href="#553">553</a> <strong class="jxr_keyword">if</strong> (samlKeyInfo == <strong class="jxr_keyword">null</strong>) {
-<a name="554" href="#554">554</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="555" href="#555">555</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>,
-<a name="556" href="#556">556</a> <strong class="jxr_keyword">new</strong> Object[]{<span class="jxr_string">"cannot get certificate or key"</span>}
-<a name="557" href="#557">557</a> );
-<a name="558" href="#558">558</a> }
-<a name="559" href="#559">559</a>
-<a name="560" href="#560">560</a> BasicX509Credential credential = <strong class="jxr_keyword">new</strong> BasicX509Credential();
-<a name="561" href="#561">561</a> <strong class="jxr_keyword">if</strong> (samlKeyInfo.getCerts() != <strong class="jxr_keyword">null</strong>) {
-<a name="562" href="#562">562</a> credential.setEntityCertificate(samlKeyInfo.getCerts()[0]);
-<a name="563" href="#563">563</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (samlKeyInfo.getPublicKey() != <strong class="jxr_keyword">null</strong>) {
-<a name="564" href="#564">564</a> credential.setPublicKey(samlKeyInfo.getPublicKey());
-<a name="565" href="#565">565</a> } <strong class="jxr_keyword">else</strong> {
-<a name="566" href="#566">566</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="567" href="#567">567</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>,
-<a name="568" href="#568">568</a> <strong class="jxr_keyword">new</strong> Object[]{<span class="jxr_string">"cannot get certificate or key"</span>}
-<a name="569" href="#569">569</a> );
-<a name="570" href="#570">570</a> }
-<a name="571" href="#571">571</a> SignatureValidator sigValidator = <strong class="jxr_keyword">new</strong> SignatureValidator(credential);
-<a name="572" href="#572">572</a> <strong class="jxr_keyword">try</strong> {
-<a name="573" href="#573">573</a> sigValidator.validate(sig);
-<a name="574" href="#574">574</a> } <strong class="jxr_keyword">catch</strong> (ValidationException ex) {
-<a name="575" href="#575">575</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(<span class="jxr_string">"SAML signature validation failed"</span>, ex);
+<a name="536" href="#536">536</a> <strong class="jxr_keyword">if</strong> (keyInfo == <strong class="jxr_keyword">null</strong>) {
+<a name="537" href="#537">537</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="538" href="#538">538</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>,
+<a name="539" href="#539">539</a> <strong class="jxr_keyword">new</strong> Object[]{<span class="jxr_string">"cannot get certificate or key"</span>}
+<a name="540" href="#540">540</a> );
+<a name="541" href="#541">541</a> }
+<a name="542" href="#542">542</a> <a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> samlKeyInfo =
+<a name="543" href="#543">543</a> SAMLUtil.getCredentialFromKeyInfo(keyInfo.getDOM(), data, docInfo, data.getWssConfig().isWsiBSPCompliant());
+<a name="544" href="#544">544</a> verifySignature(samlKeyInfo);
+<a name="545" href="#545">545</a> } <strong class="jxr_keyword">else</strong> {
+<a name="546" href="#546">546</a> LOG.debug(<span class="jxr_string">"AssertionWrapper: no signature to validate"</span>);
+<a name="547" href="#547">547</a> }
+<a name="548" href="#548">548</a>
+<a name="549" href="#549">549</a> }
+<a name="550" href="#550">550</a>
+<a name="551" href="#551">551</a> <em class="jxr_javadoccomment">/**</em>
+<a name="552" href="#552">552</a> <em class="jxr_javadoccomment"> * Verify the signature of this assertion</em>
+<a name="553" href="#553">553</a> <em class="jxr_javadoccomment"> *</em>
+<a name="554" href="#554">554</a> <em class="jxr_javadoccomment"> * @throws ValidationException</em>
+<a name="555" href="#555">555</a> <em class="jxr_javadoccomment"> */</em>
+<a name="556" href="#556">556</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> verifySignature(<a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> samlKeyInfo) <strong class="jxr_keyword">throws</strong> WSSecurityException {
+<a name="557" href="#557">557</a> Signature sig = getSignature();
+<a name="558" href="#558">558</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
+<a name="559" href="#559">559</a> <strong class="jxr_keyword">if</strong> (samlKeyInfo == <strong class="jxr_keyword">null</strong>) {
+<a name="560" href="#560">560</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="561" href="#561">561</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>,
+<a name="562" href="#562">562</a> <strong class="jxr_keyword">new</strong> Object[]{<span class="jxr_string">"cannot get certificate or key"</span>}
+<a name="563" href="#563">563</a> );
+<a name="564" href="#564">564</a> }
+<a name="565" href="#565">565</a>
+<a name="566" href="#566">566</a> BasicX509Credential credential = <strong class="jxr_keyword">new</strong> BasicX509Credential();
+<a name="567" href="#567">567</a> <strong class="jxr_keyword">if</strong> (samlKeyInfo.getCerts() != <strong class="jxr_keyword">null</strong>) {
+<a name="568" href="#568">568</a> credential.setEntityCertificate(samlKeyInfo.getCerts()[0]);
+<a name="569" href="#569">569</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (samlKeyInfo.getPublicKey() != <strong class="jxr_keyword">null</strong>) {
+<a name="570" href="#570">570</a> credential.setPublicKey(samlKeyInfo.getPublicKey());
+<a name="571" href="#571">571</a> } <strong class="jxr_keyword">else</strong> {
+<a name="572" href="#572">572</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="573" href="#573">573</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>,
+<a name="574" href="#574">574</a> <strong class="jxr_keyword">new</strong> Object[]{<span class="jxr_string">"cannot get certificate or key"</span>}
+<a name="575" href="#575">575</a> );
<a name="576" href="#576">576</a> }
-<a name="577" href="#577">577</a> signatureKeyInfo = samlKeyInfo;
-<a name="578" href="#578">578</a> } <strong class="jxr_keyword">else</strong> {
-<a name="579" href="#579">579</a> LOG.debug(<span class="jxr_string">"AssertionWrapper: no signature to validate"</span>);
-<a name="580" href="#580">580</a> }
-<a name="581" href="#581">581</a> }
-<a name="582" href="#582">582</a>
-<a name="583" href="#583">583</a> <em class="jxr_javadoccomment">/**</em>
-<a name="584" href="#584">584</a> <em class="jxr_javadoccomment"> * Validate the signature of the Assertion against the Profile. This does not actually</em>
-<a name="585" href="#585">585</a> <em class="jxr_javadoccomment"> * verify the signature itself (see the verifySignature method for this)</em>
-<a name="586" href="#586">586</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
-<a name="587" href="#587">587</a> <em class="jxr_javadoccomment"> */</em>
-<a name="588" href="#588">588</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> validateSignatureAgainstProfile() <strong class="jxr_keyword">throws</strong> WSSecurityException {
-<a name="589" href="#589">589</a> Signature sig = getSignature();
-<a name="590" href="#590">590</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
-<a name="591" href="#591">591</a> SAMLSignatureProfileValidator validator = <strong class="jxr_keyword">new</strong> SAMLSignatureProfileValidator();
-<a name="592" href="#592">592</a> <strong class="jxr_keyword">try</strong> {
-<a name="593" href="#593">593</a> validator.validate(sig);
-<a name="594" href="#594">594</a> } <strong class="jxr_keyword">catch</strong> (ValidationException ex) {
-<a name="595" href="#595">595</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(<span class="jxr_string">"SAML signature validation failed"</span>, ex);
-<a name="596" href="#596">596</a> }
-<a name="597" href="#597">597</a> }
-<a name="598" href="#598">598</a> }
-<a name="599" href="#599">599</a>
-<a name="600" href="#600">600</a> <strong class="jxr_keyword">public</strong> Signature getSignature() {
-<a name="601" href="#601">601</a> Signature sig = <strong class="jxr_keyword">null</strong>;
-<a name="602" href="#602">602</a> <strong class="jxr_keyword">if</strong> (saml2 != <strong class="jxr_keyword">null</strong> && saml2.getSignature() != <strong class="jxr_keyword">null</strong>) {
-<a name="603" href="#603">603</a> sig = saml2.getSignature();
-<a name="604" href="#604">604</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong> && saml1.getSignature() != <strong class="jxr_keyword">null</strong>) {
-<a name="605" href="#605">605</a> sig = saml1.getSignature();
-<a name="606" href="#606">606</a> }
-<a name="607" href="#607">607</a> <strong class="jxr_keyword">return</strong> sig;
-<a name="608" href="#608">608</a> }
-<a name="609" href="#609">609</a>
-<a name="610" href="#610">610</a>
-<a name="611" href="#611">611</a> <em class="jxr_javadoccomment">/**</em>
-<a name="612" href="#612">612</a> <em class="jxr_javadoccomment"> * This method parses the KeyInfo of the Subject for the holder-of-key confirmation</em>
-<a name="613" href="#613">613</a> <em class="jxr_javadoccomment"> * method, as required by the SAML Token spec. It then stores the SAMLKeyInfo object that</em>
-<a name="614" href="#614">614</a> <em class="jxr_javadoccomment"> * has been obtained for future processing by the SignatureProcessor.</em>
-<a name="615" href="#615">615</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
-<a name="616" href="#616">616</a> <em class="jxr_javadoccomment"> */</em>
-<a name="617" href="#617">617</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> parseHOKSubject(
-<a name="618" href="#618">618</a> <a href="../../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data, <a href="../../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> docInfo
-<a name="619" href="#619">619</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="620" href="#620">620</a> String confirmMethod = <strong class="jxr_keyword">null</strong>;
-<a name="621" href="#621">621</a> List<String> methods = getConfirmationMethods();
-<a name="622" href="#622">622</a> <strong class="jxr_keyword">if</strong> (methods != <strong class="jxr_keyword">null</strong> && methods.size() > 0) {
-<a name="623" href="#623">623</a> confirmMethod = methods.get(0);
-<a name="624" href="#624">624</a> }
-<a name="625" href="#625">625</a> <strong class="jxr_keyword">if</strong> (OpenSAMLUtil.isMethodHolderOfKey(confirmMethod)) {
-<a name="626" href="#626">626</a> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong>) {
-<a name="627" href="#627">627</a> subjectKeyInfo =
-<a name="628" href="#628">628</a> SAMLUtil.getCredentialFromSubject(saml1, data, docInfo,
-<a name="629" href="#629">629</a> data.getWssConfig().isWsiBSPCompliant());
-<a name="630" href="#630">630</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml2 != <strong class="jxr_keyword">null</strong>) {
-<a name="631" href="#631">631</a> subjectKeyInfo =
-<a name="632" href="#632">632</a> SAMLUtil.getCredentialFromSubject(saml2, data, docInfo,
-<a name="633" href="#633">633</a> data.getWssConfig().isWsiBSPCompliant());
-<a name="634" href="#634">634</a> }
-<a name="635" href="#635">635</a> }
-<a name="636" href="#636">636</a> }
-<a name="637" href="#637">637</a>
-<a name="638" href="#638">638</a>
-<a name="639" href="#639">639</a> <em class="jxr_javadoccomment">/**</em>
-<a name="640" href="#640">640</a> <em class="jxr_javadoccomment"> * Method getSamlVersion returns the samlVersion of this AssertionWrapper object.</em>
-<a name="641" href="#641">641</a> <em class="jxr_javadoccomment"> *</em>
-<a name="642" href="#642">642</a> <em class="jxr_javadoccomment"> * @return the samlVersion (type SAMLVersion) of this AssertionWrapper object.</em>
-<a name="643" href="#643">643</a> <em class="jxr_javadoccomment"> */</em>
-<a name="644" href="#644">644</a> <strong class="jxr_keyword">public</strong> SAMLVersion getSamlVersion() {
-<a name="645" href="#645">645</a> <strong class="jxr_keyword">if</strong> (samlVersion == <strong class="jxr_keyword">null</strong>) {
-<a name="646" href="#646">646</a> <em class="jxr_comment">// Try to set the version.</em>
-<a name="647" href="#647">647</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a name="648" href="#648">648</a> LOG.debug(
-<a name="649" href="#649">649</a> <span class="jxr_string">"The SAML version was null in getSamlVersion(). Recomputing SAML version..."</span>
-<a name="650" href="#650">650</a> );
-<a name="651" href="#651">651</a> }
-<a name="652" href="#652">652</a> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong> && saml2 == <strong class="jxr_keyword">null</strong>) {
-<a name="653" href="#653">653</a> samlVersion = SAMLVersion.VERSION_11;
-<a name="654" href="#654">654</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml1 == <strong class="jxr_keyword">null</strong> && saml2 != <strong class="jxr_keyword">null</strong>) {
-<a name="655" href="#655">655</a> samlVersion = SAMLVersion.VERSION_20;
-<a name="656" href="#656">656</a> } <strong class="jxr_keyword">else</strong> {
-<a name="657" href="#657">657</a> <em class="jxr_comment">// We are only supporting SAML v1.1 or SAML v2.0 at this time.</em>
-<a name="658" href="#658">658</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IllegalStateException(
-<a name="659" href="#659">659</a> <span class="jxr_string">"Could not determine the SAML version number. Check your "</span>
-<a name="660" href="#660">660</a> + <span class="jxr_string">"configuration and try again."</span>
-<a name="661" href="#661">661</a> );
-<a name="662" href="#662">662</a> }
-<a name="663" href="#663">663</a> }
-<a name="664" href="#664">664</a> <strong class="jxr_keyword">return</strong> samlVersion;
-<a name="665" href="#665">665</a> }
-<a name="666" href="#666">666</a>
-<a name="667" href="#667">667</a> <em class="jxr_javadoccomment">/**</em>
-<a name="668" href="#668">668</a> <em class="jxr_javadoccomment"> * Get the Assertion as a DOM Element.</em>
-<a name="669" href="#669">669</a> <em class="jxr_javadoccomment"> * @return the assertion as a DOM Element</em>
-<a name="670" href="#670">670</a> <em class="jxr_javadoccomment"> */</em>
-<a name="671" href="#671">671</a> <strong class="jxr_keyword">public</strong> Element getElement() {
-<a name="672" href="#672">672</a> <strong class="jxr_keyword">return</strong> assertionElement;
-<a name="673" href="#673">673</a> }
-<a name="674" href="#674">674</a>
-<a name="675" href="#675">675</a> <em class="jxr_javadoccomment">/**</em>
-<a name="676" href="#676">676</a> <em class="jxr_javadoccomment"> * Get the SAMLKeyInfo associated with the signature of the assertion</em>
-<a name="677" href="#677">677</a> <em class="jxr_javadoccomment"> * @return the SAMLKeyInfo associated with the signature of the assertion</em>
-<a name="678" href="#678">678</a> <em class="jxr_javadoccomment"> */</em>
-<a name="679" href="#679">679</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> getSignatureKeyInfo() {
-<a name="680" href="#680">680</a> <strong class="jxr_keyword">return</strong> signatureKeyInfo;
-<a name="681" href="#681">681</a> }
-<a name="682" href="#682">682</a>
-<a name="683" href="#683">683</a> <em class="jxr_javadoccomment">/**</em>
-<a name="684" href="#684">684</a> <em class="jxr_javadoccomment"> * Get the SAMLKeyInfo associated with the Subject KeyInfo</em>
-<a name="685" href="#685">685</a> <em class="jxr_javadoccomment"> * @return the SAMLKeyInfo associated with the Subject KeyInfo</em>
-<a name="686" href="#686">686</a> <em class="jxr_javadoccomment"> */</em>
-<a name="687" href="#687">687</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> getSubjectKeyInfo() {
-<a name="688" href="#688">688</a> <strong class="jxr_keyword">return</strong> subjectKeyInfo;
-<a name="689" href="#689">689</a> }
-<a name="690" href="#690">690</a>
-<a name="691" href="#691">691</a> <em class="jxr_javadoccomment">/**</em>
-<a name="692" href="#692">692</a> <em class="jxr_javadoccomment"> * Get the SignatureValue bytes of the signed SAML Assertion </em>
-<a name="693" href="#693">693</a> <em class="jxr_javadoccomment"> * @return the SignatureValue bytes of the signed SAML Assertion </em>
-<a name="694" href="#694">694</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
-<a name="695" href="#695">695</a> <em class="jxr_javadoccomment"> */</em>
-<a name="696" href="#696">696</a> <strong class="jxr_keyword">public</strong> byte[] getSignatureValue() <strong class="jxr_keyword">throws</strong> WSSecurityException {
-<a name="697" href="#697">697</a> Signature sig = <strong class="jxr_keyword">null</strong>;
-<a name="698" href="#698">698</a> <strong class="jxr_keyword">if</strong> (saml2 != <strong class="jxr_keyword">null</strong> && saml2.getSignature() != <strong class="jxr_keyword">null</strong>) {
-<a name="699" href="#699">699</a> sig = saml2.getSignature();
-<a name="700" href="#700">700</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong> && saml1.getSignature() != <strong class="jxr_keyword">null</strong>) {
-<a name="701" href="#701">701</a> sig = saml1.getSignature();
-<a name="702" href="#702">702</a> }
-<a name="703" href="#703">703</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
-<a name="704" href="#704">704</a> Element signatureElement = sig.getDOM();
-<a name="705" href="#705">705</a>
-<a name="706" href="#706">706</a> <strong class="jxr_keyword">try</strong> {
-<a name="707" href="#707">707</a> <em class="jxr_comment">// Use XML-Security class to obtain SignatureValue</em>
-<a name="708" href="#708">708</a> XMLSignature xmlSignature = <strong class="jxr_keyword">new</strong> XMLSignature(signatureElement, <span class="jxr_string">""</span>);
-<a name="709" href="#709">709</a> <strong class="jxr_keyword">return</strong> xmlSignature.getSignatureValue();
-<a name="710" href="#710">710</a> } <strong class="jxr_keyword">catch</strong> (XMLSignatureException e) {
-<a name="711" href="#711">711</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="712" href="#712">712</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>, <strong class="jxr_keyword">null</strong>, e
-<a name="713" href="#713">713</a> );
-<a name="714" href="#714">714</a> } <strong class="jxr_keyword">catch</strong> (XMLSecurityException e) {
-<a name="715" href="#715">715</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="716" href="#716">716</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>, <strong class="jxr_keyword">null</strong>, e
-<a name="717" href="#717">717</a> );
-<a name="718" href="#718">718</a> }
-<a name="719" href="#719">719</a> }
-<a name="720" href="#720">720</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
-<a name="721" href="#721">721</a> }
-<a name="722" href="#722">722</a>
-<a name="723" href="#723">723</a> <em class="jxr_javadoccomment">/**</em>
-<a name="724" href="#724">724</a> <em class="jxr_javadoccomment"> * Parse the DOM Element into Opensaml objects.</em>
-<a name="725" href="#725">725</a> <em class="jxr_javadoccomment"> */</em>
-<a name="726" href="#726">726</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> parseElement(Element element) <strong class="jxr_keyword">throws</strong> WSSecurityException {
-<a name="727" href="#727">727</a> <strong class="jxr_keyword">this</strong>.xmlObject = OpenSAMLUtil.fromDom(element);
-<a name="728" href="#728">728</a> <strong class="jxr_keyword">if</strong> (xmlObject instanceof org.opensaml.saml1.core.Assertion) {
-<a name="729" href="#729">729</a> <strong class="jxr_keyword">this</strong>.saml1 = (org.opensaml.saml1.core.Assertion) xmlObject;
-<a name="730" href="#730">730</a> samlVersion = SAMLVersion.VERSION_11;
-<a name="731" href="#731">731</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (xmlObject instanceof org.opensaml.saml2.core.Assertion) {
-<a name="732" href="#732">732</a> <strong class="jxr_keyword">this</strong>.saml2 = (org.opensaml.saml2.core.Assertion) xmlObject;
-<a name="733" href="#733">733</a> samlVersion = SAMLVersion.VERSION_20;
-<a name="734" href="#734">734</a> } <strong class="jxr_keyword">else</strong> {
-<a name="735" href="#735">735</a> LOG.error(
-<a name="736" href="#736">736</a> <span class="jxr_string">"AssertionWrapper: found unexpected type "</span>
-<a name="737" href="#737">737</a> + (xmlObject != <strong class="jxr_keyword">null</strong> ? xmlObject.getClass().getName() : xmlObject)
-<a name="738" href="#738">738</a> );
-<a name="739" href="#739">739</a> }
-<a name="740" href="#740">740</a>
-<a name="741" href="#741">741</a> assertionElement = element;
-<a name="742" href="#742">742</a> }
-<a name="743" href="#743">743</a>
-<a name="744" href="#744">744</a> <em class="jxr_javadoccomment">/**</em>
-<a name="745" href="#745">745</a> <em class="jxr_javadoccomment"> * Parse a SAMLCallback object to create a SAML Assertion</em>
-<a name="746" href="#746">746</a> <em class="jxr_javadoccomment"> */</em>
-<a name="747" href="#747">747</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> parseCallback(
-<a name="748" href="#748">748</a> <a href="../../../../../../org/apache/ws/security/saml/ext/SAMLCallback.html">SAMLCallback</a> samlCallback, <a href="../../../../../../org/apache/ws/security/saml/ext/SAMLParms.html">SAMLParms</a> parms
-<a name="749" href="#749">749</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
-<a name="750" href="#750">750</a> samlVersion = samlCallback.getSamlVersion();
-<a name="751" href="#751">751</a> <strong class="jxr_keyword">if</strong> (samlVersion == <strong class="jxr_keyword">null</strong>) {
-<a name="752" href="#752">752</a> samlVersion = parms.getSAMLVersion();
-<a name="753" href="#753">753</a> }
-<a name="754" href="#754">754</a> String issuer = samlCallback.getIssuer();
-<a name="755" href="#755">755</a> <strong class="jxr_keyword">if</strong> (issuer == <strong class="jxr_keyword">null</strong> && parms.getIssuer() != <strong class="jxr_keyword">null</strong>) {
-<a name="756" href="#756">756</a> issuer = parms.getIssuer();
-<a name="757" href="#757">757</a> }
-<a name="758" href="#758">758</a> <strong class="jxr_keyword">if</strong> (samlVersion.equals(SAMLVersion.VERSION_11)) {
-<a name="759" href="#759">759</a> <em class="jxr_comment">// Build a SAML v1.1 assertion</em>
-<a name="760" href="#760">760</a> saml1 = SAML1ComponentBuilder.createSamlv1Assertion(issuer);
-<a name="761" href="#761">761</a>
-<a name="762" href="#762">762</a> <strong class="jxr_keyword">try</strong> {
-<a name="763" href="#763">763</a> <em class="jxr_comment">// Process the SAML authentication statement(s)</em>
-<a name="764" href="#764">764</a> List<AuthenticationStatement> authenticationStatements =
-<a name="765" href="#765">765</a> SAML1ComponentBuilder.createSamlv1AuthenticationStatement(
-<a name="766" href="#766">766</a> samlCallback.getAuthenticationStatementData()
-<a name="767" href="#767">767</a> );
-<a name="768" href="#768">768</a> saml1.getAuthenticationStatements().addAll(authenticationStatements);
-<a name="769" href="#769">769</a>
-<a name="770" href="#770">770</a> <em class="jxr_comment">// Process the SAML attribute statement(s) </em>
-<a name="771" href="#771">771</a> List<AttributeStatement> attributeStatements =
-<a name="772" href="#772">772</a> SAML1ComponentBuilder.createSamlv1AttributeStatement(
-<a name="773" href="#773">773</a> samlCallback.getAttributeStatementData()
-<a name="774" href="#774">774</a> );
-<a name="775" href="#775">775</a> saml1.getAttributeStatements().addAll(attributeStatements);
-<a name="776" href="#776">776</a>
-<a name="777" href="#777">777</a> <em class="jxr_comment">// Process the SAML authorization decision statement(s)</em>
-<a name="778" href="#778">778</a> List<AuthorizationDecisionStatement> authDecisionStatements =
-<a name="779" href="#779">779</a> SAML1ComponentBuilder.createSamlv1AuthorizationDecisionStatement(
-<a name="780" href="#780">780</a> samlCallback.getAuthDecisionStatementData()
-<a name="781" href="#781">781</a> );
-<a name="782" href="#782">782</a> saml1.getAuthorizationDecisionStatements().addAll(authDecisionStatements);
-<a name="783" href="#783">783</a>
-<a name="784" href="#784">784</a> <em class="jxr_comment">// Build the complete assertion</em>
-<a name="785" href="#785">785</a> org.opensaml.saml1.core.Conditions conditions =
-<a name="786" href="#786">786</a> SAML1ComponentBuilder.createSamlv1Conditions(samlCallback.getConditions());
-<a name="787" href="#787">787</a> saml1.setConditions(conditions);
-<a name="788" href="#788">788</a> } <strong class="jxr_keyword">catch</strong> (org.opensaml.xml.security.SecurityException ex) {
-<a name="789" href="#789">789</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="790" href="#790">790</a> <span class="jxr_string">"Error generating KeyInfo from signing credential"</span>, ex
-<a name="791" href="#791">791</a> );
-<a name="792" href="#792">792</a> }
-<a name="793" href="#793">793</a>
-<a name="794" href="#794">794</a> <em class="jxr_comment">// Set the OpenSaml2 XMLObject instance</em>
-<a name="795" href="#795">795</a> xmlObject = saml1;
-<a name="796" href="#796">796</a>
-<a name="797" href="#797">797</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (samlVersion.equals(SAMLVersion.VERSION_20)) {
-<a name="798" href="#798">798</a> <em class="jxr_comment">// Build a SAML v2.0 assertion</em>
-<a name="799" href="#799">799</a> saml2 = SAML2ComponentBuilder.createAssertion();
-<a name="800" href="#800">800</a> Issuer samlIssuer = SAML2ComponentBuilder.createIssuer(issuer);
-<a name="801" href="#801">801</a>
-<a name="802" href="#802">802</a> <em class="jxr_comment">// Authn Statement(s)</em>
-<a name="803" href="#803">803</a> List<AuthnStatement> authnStatements =
-<a name="804" href="#804">804</a> SAML2ComponentBuilder.createAuthnStatement(
-<a name="805" href="#805">805</a> samlCallback.getAuthenticationStatementData()
-<a name="806" href="#806">806</a> );
-<a name="807" href="#807">807</a> saml2.getAuthnStatements().addAll(authnStatements);
-<a name="808" href="#808">808</a>
-<a name="809" href="#809">809</a> <em class="jxr_comment">// Attribute statement(s)</em>
-<a name="810" href="#810">810</a> List<org.opensaml.saml2.core.AttributeStatement> attributeStatements =
-<a name="811" href="#811">811</a> SAML2ComponentBuilder.createAttributeStatement(
-<a name="812" href="#812">812</a> samlCallback.getAttributeStatementData()
-<a name="813" href="#813">813</a> );
-<a name="814" href="#814">814</a> saml2.getAttributeStatements().addAll(attributeStatements);
-<a name="815" href="#815">815</a>
-<a name="816" href="#816">816</a> <em class="jxr_comment">// AuthzDecisionStatement(s)</em>
-<a name="817" href="#817">817</a> List<AuthzDecisionStatement> authDecisionStatements =
-<a name="818" href="#818">818</a> SAML2ComponentBuilder.createAuthorizationDecisionStatement(
-<a name="819" href="#819">819</a> samlCallback.getAuthDecisionStatementData()
-<a name="820" href="#820">820</a> );
-<a name="821" href="#821">821</a> saml2.getAuthzDecisionStatements().addAll(authDecisionStatements);
-<a name="822" href="#822">822</a>
-<a name="823" href="#823">823</a> <em class="jxr_comment">// Build the SAML v2.0 assertion</em>
-<a name="824" href="#824">824</a> saml2.setIssuer(samlIssuer);
-<a name="825" href="#825">825</a>
-<a name="826" href="#826">826</a> <strong class="jxr_keyword">try</strong> {
-<a name="827" href="#827">827</a> org.opensaml.saml2.core.Subject subject =
-<a name="828" href="#828">828</a> SAML2ComponentBuilder.createSaml2Subject(samlCallback.getSubject());
-<a name="829" href="#829">829</a> saml2.setSubject(subject);
-<a name="830" href="#830">830</a> } <strong class="jxr_keyword">catch</strong> (org.opensaml.xml.security.SecurityException ex) {
-<a name="831" href="#831">831</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="832" href="#832">832</a> <span class="jxr_string">"Error generating KeyInfo from signing credential"</span>, ex
-<a name="833" href="#833">833</a> );
-<a name="834" href="#834">834</a> }
-<a name="835" href="#835">835</a>
-<a name="836" href="#836">836</a> org.opensaml.saml2.core.Conditions conditions =
-<a name="837" href="#837">837</a> SAML2ComponentBuilder.createConditions(samlCallback.getConditions());
-<a name="838" href="#838">838</a> saml2.setConditions(conditions);
-<a name="839" href="#839">839</a>
-<a name="840" href="#840">840</a> <em class="jxr_comment">// Set the OpenSaml2 XMLObject instance</em>
-<a name="841" href="#841">841</a> xmlObject = saml2;
-<a name="842" href="#842">842</a> }
-<a name="843" href="#843">843</a> }
-<a name="844" href="#844">844</a>
-<a name="845" href="#845">845</a> }
+<a name="577" href="#577">577</a> SignatureValidator sigValidator = <strong class="jxr_keyword">new</strong> SignatureValidator(credential);
+<a name="578" href="#578">578</a> <strong class="jxr_keyword">try</strong> {
+<a name="579" href="#579">579</a> sigValidator.validate(sig);
+<a name="580" href="#580">580</a> } <strong class="jxr_keyword">catch</strong> (ValidationException ex) {
+<a name="581" href="#581">581</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(<span class="jxr_string">"SAML signature validation failed"</span>, ex);
+<a name="582" href="#582">582</a> }
+<a name="583" href="#583">583</a> signatureKeyInfo = samlKeyInfo;
+<a name="584" href="#584">584</a> } <strong class="jxr_keyword">else</strong> {
+<a name="585" href="#585">585</a> LOG.debug(<span class="jxr_string">"AssertionWrapper: no signature to validate"</span>);
+<a name="586" href="#586">586</a> }
+<a name="587" href="#587">587</a> }
+<a name="588" href="#588">588</a>
+<a name="589" href="#589">589</a> <em class="jxr_javadoccomment">/**</em>
+<a name="590" href="#590">590</a> <em class="jxr_javadoccomment"> * Validate the signature of the Assertion against the Profile. This does not actually</em>
+<a name="591" href="#591">591</a> <em class="jxr_javadoccomment"> * verify the signature itself (see the verifySignature method for this)</em>
+<a name="592" href="#592">592</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
+<a name="593" href="#593">593</a> <em class="jxr_javadoccomment"> */</em>
+<a name="594" href="#594">594</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> validateSignatureAgainstProfile() <strong class="jxr_keyword">throws</strong> WSSecurityException {
+<a name="595" href="#595">595</a> Signature sig = getSignature();
+<a name="596" href="#596">596</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
+<a name="597" href="#597">597</a> SAMLSignatureProfileValidator validator = <strong class="jxr_keyword">new</strong> SAMLSignatureProfileValidator();
+<a name="598" href="#598">598</a> <strong class="jxr_keyword">try</strong> {
+<a name="599" href="#599">599</a> validator.validate(sig);
+<a name="600" href="#600">600</a> } <strong class="jxr_keyword">catch</strong> (ValidationException ex) {
+<a name="601" href="#601">601</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a>(<span class="jxr_string">"SAML signature validation failed"</span>, ex);
+<a name="602" href="#602">602</a> }
+<a name="603" href="#603">603</a> }
+<a name="604" href="#604">604</a> }
+<a name="605" href="#605">605</a>
+<a name="606" href="#606">606</a> <strong class="jxr_keyword">public</strong> Signature getSignature() {
+<a name="607" href="#607">607</a> Signature sig = <strong class="jxr_keyword">null</strong>;
+<a name="608" href="#608">608</a> <strong class="jxr_keyword">if</strong> (saml2 != <strong class="jxr_keyword">null</strong> && saml2.getSignature() != <strong class="jxr_keyword">null</strong>) {
+<a name="609" href="#609">609</a> sig = saml2.getSignature();
+<a name="610" href="#610">610</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong> && saml1.getSignature() != <strong class="jxr_keyword">null</strong>) {
+<a name="611" href="#611">611</a> sig = saml1.getSignature();
+<a name="612" href="#612">612</a> }
+<a name="613" href="#613">613</a> <strong class="jxr_keyword">return</strong> sig;
+<a name="614" href="#614">614</a> }
+<a name="615" href="#615">615</a>
+<a name="616" href="#616">616</a>
+<a name="617" href="#617">617</a> <em class="jxr_javadoccomment">/**</em>
+<a name="618" href="#618">618</a> <em class="jxr_javadoccomment"> * This method parses the KeyInfo of the Subject for the holder-of-key confirmation</em>
+<a name="619" href="#619">619</a> <em class="jxr_javadoccomment"> * method, as required by the SAML Token spec. It then stores the SAMLKeyInfo object that</em>
+<a name="620" href="#620">620</a> <em class="jxr_javadoccomment"> * has been obtained for future processing by the SignatureProcessor.</em>
+<a name="621" href="#621">621</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
+<a name="622" href="#622">622</a> <em class="jxr_javadoccomment"> */</em>
+<a name="623" href="#623">623</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> parseHOKSubject(
+<a name="624" href="#624">624</a> <a href="../../../../../../org/apache/ws/security/handler/RequestData.html">RequestData</a> data, <a href="../../../../../../org/apache/ws/security/WSDocInfo.html">WSDocInfo</a> docInfo
+<a name="625" href="#625">625</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="626" href="#626">626</a> String confirmMethod = <strong class="jxr_keyword">null</strong>;
+<a name="627" href="#627">627</a> List<String> methods = getConfirmationMethods();
+<a name="628" href="#628">628</a> <strong class="jxr_keyword">if</strong> (methods != <strong class="jxr_keyword">null</strong> && methods.size() > 0) {
+<a name="629" href="#629">629</a> confirmMethod = methods.get(0);
+<a name="630" href="#630">630</a> }
+<a name="631" href="#631">631</a> <strong class="jxr_keyword">if</strong> (OpenSAMLUtil.isMethodHolderOfKey(confirmMethod)) {
+<a name="632" href="#632">632</a> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong>) {
+<a name="633" href="#633">633</a> subjectKeyInfo =
+<a name="634" href="#634">634</a> SAMLUtil.getCredentialFromSubject(saml1, data, docInfo,
+<a name="635" href="#635">635</a> data.getWssConfig().isWsiBSPCompliant());
+<a name="636" href="#636">636</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml2 != <strong class="jxr_keyword">null</strong>) {
+<a name="637" href="#637">637</a> subjectKeyInfo =
+<a name="638" href="#638">638</a> SAMLUtil.getCredentialFromSubject(saml2, data, docInfo,
+<a name="639" href="#639">639</a> data.getWssConfig().isWsiBSPCompliant());
+<a name="640" href="#640">640</a> }
+<a name="641" href="#641">641</a> }
+<a name="642" href="#642">642</a> }
+<a name="643" href="#643">643</a>
+<a name="644" href="#644">644</a>
+<a name="645" href="#645">645</a> <em class="jxr_javadoccomment">/**</em>
+<a name="646" href="#646">646</a> <em class="jxr_javadoccomment"> * Method getSamlVersion returns the samlVersion of this AssertionWrapper object.</em>
+<a name="647" href="#647">647</a> <em class="jxr_javadoccomment"> *</em>
+<a name="648" href="#648">648</a> <em class="jxr_javadoccomment"> * @return the samlVersion (type SAMLVersion) of this AssertionWrapper object.</em>
+<a name="649" href="#649">649</a> <em class="jxr_javadoccomment"> */</em>
+<a name="650" href="#650">650</a> <strong class="jxr_keyword">public</strong> SAMLVersion getSamlVersion() {
+<a name="651" href="#651">651</a> <strong class="jxr_keyword">if</strong> (samlVersion == <strong class="jxr_keyword">null</strong>) {
+<a name="652" href="#652">652</a> <em class="jxr_comment">// Try to set the version.</em>
+<a name="653" href="#653">653</a> <strong class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a name="654" href="#654">654</a> LOG.debug(
+<a name="655" href="#655">655</a> <span class="jxr_string">"The SAML version was null in getSamlVersion(). Recomputing SAML version..."</span>
+<a name="656" href="#656">656</a> );
+<a name="657" href="#657">657</a> }
+<a name="658" href="#658">658</a> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong> && saml2 == <strong class="jxr_keyword">null</strong>) {
+<a name="659" href="#659">659</a> samlVersion = SAMLVersion.VERSION_11;
+<a name="660" href="#660">660</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml1 == <strong class="jxr_keyword">null</strong> && saml2 != <strong class="jxr_keyword">null</strong>) {
+<a name="661" href="#661">661</a> samlVersion = SAMLVersion.VERSION_20;
+<a name="662" href="#662">662</a> } <strong class="jxr_keyword">else</strong> {
+<a name="663" href="#663">663</a> <em class="jxr_comment">// We are only supporting SAML v1.1 or SAML v2.0 at this time.</em>
+<a name="664" href="#664">664</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IllegalStateException(
+<a name="665" href="#665">665</a> <span class="jxr_string">"Could not determine the SAML version number. Check your "</span>
+<a name="666" href="#666">666</a> + <span class="jxr_string">"configuration and try again."</span>
+<a name="667" href="#667">667</a> );
+<a name="668" href="#668">668</a> }
+<a name="669" href="#669">669</a> }
+<a name="670" href="#670">670</a> <strong class="jxr_keyword">return</strong> samlVersion;
+<a name="671" href="#671">671</a> }
+<a name="672" href="#672">672</a>
+<a name="673" href="#673">673</a> <em class="jxr_javadoccomment">/**</em>
+<a name="674" href="#674">674</a> <em class="jxr_javadoccomment"> * Get the Assertion as a DOM Element.</em>
+<a name="675" href="#675">675</a> <em class="jxr_javadoccomment"> * @return the assertion as a DOM Element</em>
+<a name="676" href="#676">676</a> <em class="jxr_javadoccomment"> */</em>
+<a name="677" href="#677">677</a> <strong class="jxr_keyword">public</strong> Element getElement() {
+<a name="678" href="#678">678</a> <strong class="jxr_keyword">return</strong> assertionElement;
+<a name="679" href="#679">679</a> }
+<a name="680" href="#680">680</a>
+<a name="681" href="#681">681</a> <em class="jxr_javadoccomment">/**</em>
+<a name="682" href="#682">682</a> <em class="jxr_javadoccomment"> * Get the SAMLKeyInfo associated with the signature of the assertion</em>
+<a name="683" href="#683">683</a> <em class="jxr_javadoccomment"> * @return the SAMLKeyInfo associated with the signature of the assertion</em>
+<a name="684" href="#684">684</a> <em class="jxr_javadoccomment"> */</em>
+<a name="685" href="#685">685</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> getSignatureKeyInfo() {
+<a name="686" href="#686">686</a> <strong class="jxr_keyword">return</strong> signatureKeyInfo;
+<a name="687" href="#687">687</a> }
+<a name="688" href="#688">688</a>
+<a name="689" href="#689">689</a> <em class="jxr_javadoccomment">/**</em>
+<a name="690" href="#690">690</a> <em class="jxr_javadoccomment"> * Get the SAMLKeyInfo associated with the Subject KeyInfo</em>
+<a name="691" href="#691">691</a> <em class="jxr_javadoccomment"> * @return the SAMLKeyInfo associated with the Subject KeyInfo</em>
+<a name="692" href="#692">692</a> <em class="jxr_javadoccomment"> */</em>
+<a name="693" href="#693">693</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/ws/security/saml/SAMLKeyInfo.html">SAMLKeyInfo</a> getSubjectKeyInfo() {
+<a name="694" href="#694">694</a> <strong class="jxr_keyword">return</strong> subjectKeyInfo;
+<a name="695" href="#695">695</a> }
+<a name="696" href="#696">696</a>
+<a name="697" href="#697">697</a> <em class="jxr_javadoccomment">/**</em>
+<a name="698" href="#698">698</a> <em class="jxr_javadoccomment"> * Get the SignatureValue bytes of the signed SAML Assertion </em>
+<a name="699" href="#699">699</a> <em class="jxr_javadoccomment"> * @return the SignatureValue bytes of the signed SAML Assertion </em>
+<a name="700" href="#700">700</a> <em class="jxr_javadoccomment"> * @throws WSSecurityException</em>
+<a name="701" href="#701">701</a> <em class="jxr_javadoccomment"> */</em>
+<a name="702" href="#702">702</a> <strong class="jxr_keyword">public</strong> byte[] getSignatureValue() <strong class="jxr_keyword">throws</strong> WSSecurityException {
+<a name="703" href="#703">703</a> Signature sig = <strong class="jxr_keyword">null</strong>;
+<a name="704" href="#704">704</a> <strong class="jxr_keyword">if</strong> (saml2 != <strong class="jxr_keyword">null</strong> && saml2.getSignature() != <strong class="jxr_keyword">null</strong>) {
+<a name="705" href="#705">705</a> sig = saml2.getSignature();
+<a name="706" href="#706">706</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (saml1 != <strong class="jxr_keyword">null</strong> && saml1.getSignature() != <strong class="jxr_keyword">null</strong>) {
+<a name="707" href="#707">707</a> sig = saml1.getSignature();
+<a name="708" href="#708">708</a> }
+<a name="709" href="#709">709</a> <strong class="jxr_keyword">if</strong> (sig != <strong class="jxr_keyword">null</strong>) {
+<a name="710" href="#710">710</a> Element signatureElement = sig.getDOM();
+<a name="711" href="#711">711</a>
+<a name="712" href="#712">712</a> <strong class="jxr_keyword">try</strong> {
+<a name="713" href="#713">713</a> <em class="jxr_comment">// Use XML-Security class to obtain SignatureValue</em>
+<a name="714" href="#714">714</a> XMLSignature xmlSignature = <strong class="jxr_keyword">new</strong> XMLSignature(signatureElement, <span class="jxr_string">""</span>);
+<a name="715" href="#715">715</a> <strong class="jxr_keyword">return</strong> xmlSignature.getSignatureValue();
+<a name="716" href="#716">716</a> } <strong class="jxr_keyword">catch</strong> (XMLSignatureException e) {
+<a name="717" href="#717">717</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="718" href="#718">718</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>, <strong class="jxr_keyword">null</strong>, e
+<a name="719" href="#719">719</a> );
+<a name="720" href="#720">720</a> } <strong class="jxr_keyword">catch</strong> (XMLSecurityException e) {
+<a name="721" href="#721">721</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="722" href="#722">722</a> WSSecurityException.FAILURE, <span class="jxr_string">"invalidSAMLsecurity"</span>, <strong class="jxr_keyword">null</strong>, e
+<a name="723" href="#723">723</a> );
+<a name="724" href="#724">724</a> }
+<a name="725" href="#725">725</a> }
+<a name="726" href="#726">726</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="727" href="#727">727</a> }
+<a name="728" href="#728">728</a>
+<a name="729" href="#729">729</a> <em class="jxr_javadoccomment">/**</em>
+<a name="730" href="#730">730</a> <em class="jxr_javadoccomment"> * Parse the DOM Element into Opensaml objects.</em>
+<a name="731" href="#731">731</a> <em class="jxr_javadoccomment"> */</em>
+<a name="732" href="#732">732</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> parseElement(Element element) <strong class="jxr_keyword">throws</strong> WSSecurityException {
+<a name="733" href="#733">733</a> <strong class="jxr_keyword">this</strong>.xmlObject = OpenSAMLUtil.fromDom(element);
+<a name="734" href="#734">734</a> <strong class="jxr_keyword">if</strong> (xmlObject instanceof org.opensaml.saml1.core.Assertion) {
+<a name="735" href="#735">735</a> <strong class="jxr_keyword">this</strong>.saml1 = (org.opensaml.saml1.core.Assertion) xmlObject;
+<a name="736" href="#736">736</a> samlVersion = SAMLVersion.VERSION_11;
+<a name="737" href="#737">737</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (xmlObject instanceof org.opensaml.saml2.core.Assertion) {
+<a name="738" href="#738">738</a> <strong class="jxr_keyword">this</strong>.saml2 = (org.opensaml.saml2.core.Assertion) xmlObject;
+<a name="739" href="#739">739</a> samlVersion = SAMLVersion.VERSION_20;
+<a name="740" href="#740">740</a> } <strong class="jxr_keyword">else</strong> {
+<a name="741" href="#741">741</a> LOG.error(
+<a name="742" href="#742">742</a> <span class="jxr_string">"AssertionWrapper: found unexpected type "</span>
+<a name="743" href="#743">743</a> + (xmlObject != <strong class="jxr_keyword">null</strong> ? xmlObject.getClass().getName() : xmlObject)
+<a name="744" href="#744">744</a> );
+<a name="745" href="#745">745</a> }
+<a name="746" href="#746">746</a>
+<a name="747" href="#747">747</a> assertionElement = element;
+<a name="748" href="#748">748</a> }
+<a name="749" href="#749">749</a>
+<a name="750" href="#750">750</a> <em class="jxr_javadoccomment">/**</em>
+<a name="751" href="#751">751</a> <em class="jxr_javadoccomment"> * Parse a SAMLCallback object to create a SAML Assertion</em>
+<a name="752" href="#752">752</a> <em class="jxr_javadoccomment"> */</em>
+<a name="753" href="#753">753</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> parseCallback(
+<a name="754" href="#754">754</a> <a href="../../../../../../org/apache/ws/security/saml/ext/SAMLCallback.html">SAMLCallback</a> samlCallback, <a href="../../../../../../org/apache/ws/security/saml/ext/SAMLParms.html">SAMLParms</a> parms
+<a name="755" href="#755">755</a> ) <strong class="jxr_keyword">throws</strong> <a href="../../../../../../org/apache/ws/security/WSSecurityException.html">WSSecurityException</a> {
+<a name="756" href="#756">756</a> samlVersion = samlCallback.getSamlVersion();
+<a name="757" href="#757">757</a> <strong class="jxr_keyword">if</strong> (samlVersion == <strong class="jxr_keyword">null</strong>) {
+<a name="758" href="#758">758</a> samlVersion = parms.getSAMLVersion();
+<a name="759" href="#759">759</a> }
+<a name="760" href="#760">760</a> String issuer = samlCallback.getIssuer();
+<a name="761" href="#761">761</a> <strong class="jxr_keyword">if</strong> (issuer == <strong class="jxr_keyword">null</strong> && parms.getIssuer() != <strong class="jxr_keyword">null</strong>) {
+<a name="762" href="#762">762</a> issuer = parms.getIssuer();
+<a name="763" href="#763">763</a> }
+<a name="764" href="#764">764</a> <strong class="jxr_keyword">if</strong> (samlVersion.equals(SAMLVersion.VERSION_11)) {
+<a name="765" href="#765">765</a> <em class="jxr_comment">// Build a SAML v1.1 assertion</em>
+<a name="766" href="#766">766</a> saml1 = SAML1ComponentBuilder.createSamlv1Assertion(issuer);
+<a name="767" href="#767">767</a>
+<a name="768" href="#768">768</a> <strong class="jxr_keyword">try</strong> {
+<a name="769" href="#769">769</a> <em class="jxr_comment">// Process the SAML authentication statement(s)</em>
+<a name="770" href="#770">770</a> List<AuthenticationStatement> authenticationStatements =
+<a name="771" href="#771">771</a> SAML1ComponentBuilder.createSamlv1AuthenticationStatement(
+<a name="772" href="#772">772</a> samlCallback.getAuthenticationStatementData()
+<a name="773" href="#773">773</a> );
+<a name="774" href="#774">774</a> saml1.getAuthenticationStatements().addAll(authenticationStatements);
+<a name="775" href="#775">775</a>
+<a name="776" href="#776">776</a> <em class="jxr_comment">// Process the SAML attribute statement(s) </em>
+<a name="777" href="#777">777</a> List<AttributeStatement> attributeStatements =
+<a name="778" href="#778">778</a> SAML1ComponentBuilder.createSamlv1AttributeStatement(
+<a name="779" href="#779">779</a> samlCallback.getAttributeStatementData()
+<a name="780" href="#780">780</a> );
+<a name="781" href="#781">781</a> saml1.getAttributeStatements().addAll(attributeStatements);
+<a name="782" href="#782">782</a>
+<a name="783" href="#783">783</a> <em class="jxr_comment">// Process the SAML authorization decision statement(s)</em>
+<a name="784" href="#784">784</a> List<AuthorizationDecisionStatement> authDecisionStatements =
+<a name="785" href="#785">785</a> SAML1ComponentBuilder.createSamlv1AuthorizationDecisionStatement(
+<a name="786" href="#786">786</a> samlCallback.getAuthDecisionStatementData()
+<a name="787" href="#787">787</a> );
+<a name="788" href="#788">788</a> saml1.getAuthorizationDecisionStatements().addAll(authDecisionStatements);
+<a name="789" href="#789">789</a>
+<a name="790" href="#790">790</a> <em class="jxr_comment">// Build the complete assertion</em>
+<a name="791" href="#791">791</a> org.opensaml.saml1.core.Conditions conditions =
+<a name="792" href="#792">792</a> SAML1ComponentBuilder.createSamlv1Conditions(samlCallback.getConditions());
+<a name="793" href="#793">793</a> saml1.setConditions(conditions);
+<a name="794" href="#794">794</a> } <strong class="jxr_keyword">catch</strong> (org.opensaml.xml.security.SecurityException ex) {
+<a name="795" href="#795">795</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="796" href="#796">796</a> <span class="jxr_string">"Error generating KeyInfo from signing credential"</span>, ex
+<a name="797" href="#797">797</a> );
+<a name="798" href="#798">798</a> }
+<a name="799" href="#799">799</a>
+<a name="800" href="#800">800</a> <em class="jxr_comment">// Set the OpenSaml2 XMLObject instance</em>
+<a name="801" href="#801">801</a> xmlObject = saml1;
+<a name="802" href="#802">802</a>
+<a name="803" href="#803">803</a> } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (samlVersion.equals(SAMLVersion.VERSION_20)) {
+<a name="804" href="#804">804</a> <em class="jxr_comment">// Build a SAML v2.0 assertion</em>
+<a name="805" href="#805">805</a> saml2 = SAML2ComponentBuilder.createAssertion();
+<a name="806" href="#806">806</a> Issuer samlIssuer = SAML2ComponentBuilder.createIssuer(issuer);
+<a name="807" href="#807">807</a>
+<a name="808" href="#808">808</a> <em class="jxr_comment">// Authn Statement(s)</em>
+<a name="809" href="#809">809</a> List<AuthnStatement> authnStatements =
+<a name="810" href="#810">810</a> SAML2ComponentBuilder.createAuthnStatement(
+<a name="811" href="#811">811</a> samlCallback.getAuthenticationStatementData()
+<a name="812" href="#812">812</a> );
+<a name="813" href="#813">813</a> saml2.getAuthnStatements().addAll(authnStatements);
+<a name="814" href="#814">814</a>
+<a name="815" href="#815">815</a> <em class="jxr_comment">// Attribute statement(s)</em>
+<a name="816" href="#816">816</a> List<org.opensaml.saml2.core.AttributeStatement> attributeStatements =
+<a name="817" href="#817">817</a> SAML2ComponentBuilder.createAttributeStatement(
+<a name="818" href="#818">818</a> samlCallback.getAttributeStatementData()
+<a name="819" href="#819">819</a> );
+<a name="820" href="#820">820</a> saml2.getAttributeStatements().addAll(attributeStatements);
+<a name="821" href="#821">821</a>
+<a name="822" href="#822">822</a> <em class="jxr_comment">// AuthzDecisionStatement(s)</em>
+<a name="823" href="#823">823</a> List<AuthzDecisionStatement> authDecisionStatements =
+<a name="824" href="#824">824</a> SAML2ComponentBuilder.createAuthorizationDecisionStatement(
+<a name="825" href="#825">825</a> samlCallback.getAuthDecisionStatementData()
+<a name="826" href="#826">826</a> );
+<a name="827" href="#827">827</a> saml2.getAuthzDecisionStatements().addAll(authDecisionStatements);
+<a name="828" href="#828">828</a>
+<a name="829" href="#829">829</a> <em class="jxr_comment">// Build the SAML v2.0 assertion</em>
+<a name="830" href="#830">830</a> saml2.setIssuer(samlIssuer);
+<a name="831" href="#831">831</a>
+<a name="832" href="#832">832</a> <strong class="jxr_keyword">try</strong> {
+<a name="833" href="#833">833</a> org.opensaml.saml2.core.Subject subject =
+<a name="834" href="#834">834</a> SAML2ComponentBuilder.createSaml2Subject(samlCallback.getSubject());
+<a name="835" href="#835">835</a> saml2.setSubject(subject);
+<a name="836" href="#836">836</a> } <strong class="jxr_keyword">catch</strong> (org.opensaml.xml.security.SecurityException ex) {
+<a name="837" href="#837">837</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="838" href="#838">838</a> <span class="jxr_string">"Error generating KeyInfo from signing credential"</span>, ex
+<a name="839" href="#839">839</a> );
+<a name="840" href="#840">840</a> }
+<a name="841" href="#841">841</a>
+<a name="842" href="#842">842</a> org.opensaml.saml2.core.Conditions conditions =
+<a name="843" href="#843">843</a> SAML2ComponentBuilder.createConditions(samlCallback.getConditions());
+<a name="844" href="#844">844</a> saml2.setConditions(conditions);
+<a name="845" href="#845">845</a>
+<a name="846" href="#846">846</a> <em class="jxr_comment">// Set the OpenSaml2 XMLObject instance</em>
+<a name="847" href="#847">847</a> xmlObject = saml2;
+<a name="848" href="#848">848</a> }
+<a name="849" href="#849">849</a> }
+<a name="850" href="#850">850</a>
+<a name="851" href="#851">851</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/website/wss4j/xref/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.html
URL: http://svn.apache.org/viewvc/webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.html?rev=1556777&r1=1556776&r2=1556777&view=diff
==============================================================================
--- webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.html (original)
+++ webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.html Thu Jan 9 10:29:54 2014
@@ -30,86 +30,110 @@
<a name="20" href="#20">20</a> <strong class="jxr_keyword">package</strong> org.apache.ws.security.saml.ext;
<a name="21" href="#21">21</a>
<a name="22" href="#22">22</a> <strong class="jxr_keyword">import</strong> java.io.InputStream;
-<a name="23" href="#23">23</a>
-<a name="24" href="#24">24</a> <strong class="jxr_keyword">import</strong> org.opensaml.Configuration;
-<a name="25" href="#25">25</a> <strong class="jxr_keyword">import</strong> org.opensaml.DefaultBootstrap;
-<a name="26" href="#26">26</a> <strong class="jxr_keyword">import</strong> org.opensaml.xml.ConfigurationException;
-<a name="27" href="#27">27</a> <strong class="jxr_keyword">import</strong> org.opensaml.xml.XMLConfigurator;
-<a name="28" href="#28">28</a>
-<a name="29" href="#29">29</a> <em class="jxr_javadoccomment">/**</em>
-<a name="30" href="#30">30</a> <em class="jxr_javadoccomment"> * This class intializes the Opensaml library. It is necessary to override DefaultBootstrap</em>
-<a name="31" href="#31">31</a> <em class="jxr_javadoccomment"> * to avoid instantiating Velocity, which we do not need in WSS4J.</em>
-<a name="32" href="#32">32</a> <em class="jxr_javadoccomment"> */</em>
-<a name="33" href="#33">33</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/ws/security/saml/ext/OpenSAMLBootstrap.html">OpenSAMLBootstrap</a> <strong class="jxr_keyword">extends</strong> DefaultBootstrap {
-<a name="34" href="#34">34</a>
-<a name="35" href="#35">35</a> <em class="jxr_javadoccomment">/**</em><em class="jxr_javadoccomment"> List of default XMLTooling configuration files. */</em>
-<a name="36" href="#36">36</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> String[] xmlToolingConfigs = {
-<a name="37" href="#37">37</a> <span class="jxr_string">"/default-config.xml"</span>,
-<a name="38" href="#38">38</a> <span class="jxr_string">"/schema-config.xml"</span>,
-<a name="39" href="#39">39</a> <span class="jxr_string">"/signature-config.xml"</span>,
-<a name="40" href="#40">40</a> <span class="jxr_string">"/signature-validation-config.xml"</span>,
-<a name="41" href="#41">41</a> <span class="jxr_string">"/encryption-config.xml"</span>,
-<a name="42" href="#42">42</a> <span class="jxr_string">"/encryption-validation-config.xml"</span>,
-<a name="43" href="#43">43</a> <span class="jxr_string">"/soap11-config.xml"</span>,
-<a name="44" href="#44">44</a> <span class="jxr_string">"/wsfed11-protocol-config.xml"</span>,
-<a name="45" href="#45">45</a> <span class="jxr_string">"/saml1-assertion-config.xml"</span>,
-<a name="46" href="#46">46</a> <span class="jxr_string">"/saml1-protocol-config.xml"</span>,
-<a name="47" href="#47">47</a> <span class="jxr_string">"/saml1-core-validation-config.xml"</span>,
-<a name="48" href="#48">48</a> <span class="jxr_string">"/saml2-assertion-config.xml"</span>,
-<a name="49" href="#49">49</a> <span class="jxr_string">"/saml2-protocol-config.xml"</span>,
-<a name="50" href="#50">50</a> <span class="jxr_string">"/saml2-core-validation-config.xml"</span>,
-<a name="51" href="#51">51</a> <span class="jxr_string">"/saml1-metadata-config.xml"</span>,
-<a name="52" href="#52">52</a> <span class="jxr_string">"/saml2-metadata-config.xml"</span>,
-<a name="53" href="#53">53</a> <span class="jxr_string">"/saml2-metadata-validation-config.xml"</span>,
-<a name="54" href="#54">54</a> <span class="jxr_string">"/saml2-metadata-attr-config.xml"</span>,
-<a name="55" href="#55">55</a> <span class="jxr_string">"/saml2-metadata-idp-discovery-config.xml"</span>,
-<a name="56" href="#56">56</a> <span class="jxr_string">"/saml2-metadata-ui-config.xml"</span>,
-<a name="57" href="#57">57</a> <span class="jxr_string">"/saml2-protocol-thirdparty-config.xml"</span>,
-<a name="58" href="#58">58</a> <span class="jxr_string">"/saml2-metadata-query-config.xml"</span>,
-<a name="59" href="#59">59</a> <span class="jxr_string">"/saml2-assertion-delegation-restriction-config.xml"</span>,
-<a name="60" href="#60">60</a> <span class="jxr_string">"/saml2-ecp-config.xml"</span>,
-<a name="61" href="#61">61</a> <span class="jxr_string">"/saml2-xacml2-profile.xml"</span>,
-<a name="62" href="#62">62</a> <span class="jxr_string">"/xacml10-saml2-profile-config.xml"</span>,
-<a name="63" href="#63">63</a> <span class="jxr_string">"/xacml11-saml2-profile-config.xml"</span>,
-<a name="64" href="#64">64</a> <span class="jxr_string">"/xacml20-context-config.xml"</span>,
-<a name="65" href="#65">65</a> <span class="jxr_string">"/xacml20-policy-config.xml"</span>,
-<a name="66" href="#66">66</a> <span class="jxr_string">"/xacml2-saml2-profile-config.xml"</span>,
-<a name="67" href="#67">67</a> <span class="jxr_string">"/xacml3-saml2-profile-config.xml"</span>,
-<a name="68" href="#68">68</a> <span class="jxr_string">"/wsaddressing-config.xml"</span>,
-<a name="69" href="#69">69</a> <span class="jxr_string">"/wssecurity-config.xml"</span>,
-<a name="70" href="#70">70</a> };
-<a name="71" href="#71">71</a>
-<a name="72" href="#72">72</a> <em class="jxr_javadoccomment">/**</em>
-<a name="73" href="#73">73</a> <em class="jxr_javadoccomment"> * Initializes the OpenSAML library, loading default configurations.</em>
-<a name="74" href="#74">74</a> <em class="jxr_javadoccomment"> * </em>
-<a name="75" href="#75">75</a> <em class="jxr_javadoccomment"> * @throws ConfigurationException thrown if there is a problem initializing the OpenSAML library</em>
-<a name="76" href="#76">76</a> <em class="jxr_javadoccomment"> */</em>
-<a name="77" href="#77">77</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">synchronized</strong> <strong class="jxr_keyword">void</strong> bootstrap() <strong class="jxr_keyword">throws</strong> ConfigurationException {
-<a name="78" href="#78">78</a> initializeXMLSecurity();
-<a name="79" href="#79">79</a>
-<a name="80" href="#80">80</a> initializeXMLTooling(xmlToolingConfigs);
-<a name="81" href="#81">81</a>
-<a name="82" href="#82">82</a> initializeArtifactBuilderFactories();
-<a name="83" href="#83">83</a>
-<a name="84" href="#84">84</a> initializeGlobalSecurityConfiguration();
-<a name="85" href="#85">85</a>
-<a name="86" href="#86">86</a> initializeParserPool();
-<a name="87" href="#87">87</a> }
-<a name="88" href="#88">88</a>
-<a name="89" href="#89">89</a>
-<a name="90" href="#90">90</a> <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> initializeXMLTooling(String[] providerConfigs) <strong class="jxr_keyword">throws</strong> ConfigurationException {
-<a name="91" href="#91">91</a> XMLConfigurator configurator = <strong class="jxr_keyword">new</strong> XMLConfigurator();
-<a name="92" href="#92">92</a> <strong class="jxr_keyword">for</strong> (String config : providerConfigs) {
-<a name="93" href="#93">93</a> <em class="jxr_comment">//most are found in the Configuration.class classloader</em>
-<a name="94" href="#94">94</a> InputStream ins = Configuration.<strong class="jxr_keyword">class</strong>.getResourceAsStream(config);
-<a name="95" href="#95">95</a> <strong class="jxr_keyword">if</strong> (ins == <strong class="jxr_keyword">null</strong>) {
-<a name="96" href="#96">96</a> <em class="jxr_comment">//some are from us</em>
-<a name="97" href="#97">97</a> ins = OpenSAMLBootstrap.<strong class="jxr_keyword">class</strong>.getResourceAsStream(config);
-<a name="98" href="#98">98</a> }
-<a name="99" href="#99">99</a> configurator.load(ins);
-<a name="100" href="#100">100</a> }
-<a name="101" href="#101">101</a> }
-<a name="102" href="#102">102</a> }
+<a name="23" href="#23">23</a> <strong class="jxr_keyword">import</strong> java.util.HashMap;
+<a name="24" href="#24">24</a> <strong class="jxr_keyword">import</strong> java.util.Map;
+<a name="25" href="#25">25</a>
+<a name="26" href="#26">26</a> <strong class="jxr_keyword">import</strong> javax.xml.XMLConstants;
+<a name="27" href="#27">27</a>
+<a name="28" href="#28">28</a> <strong class="jxr_keyword">import</strong> org.opensaml.Configuration;
+<a name="29" href="#29">29</a> <strong class="jxr_keyword">import</strong> org.opensaml.DefaultBootstrap;
+<a name="30" href="#30">30</a> <strong class="jxr_keyword">import</strong> org.opensaml.xml.ConfigurationException;
+<a name="31" href="#31">31</a> <strong class="jxr_keyword">import</strong> org.opensaml.xml.XMLConfigurator;
+<a name="32" href="#32">32</a> <strong class="jxr_keyword">import</strong> org.opensaml.xml.parse.StaticBasicParserPool;
+<a name="33" href="#33">33</a> <strong class="jxr_keyword">import</strong> org.opensaml.xml.parse.XMLParserException;
+<a name="34" href="#34">34</a>
+<a name="35" href="#35">35</a> <em class="jxr_javadoccomment">/**</em>
+<a name="36" href="#36">36</a> <em class="jxr_javadoccomment"> * This class intializes the Opensaml library. It is necessary to override DefaultBootstrap</em>
+<a name="37" href="#37">37</a> <em class="jxr_javadoccomment"> * to avoid instantiating Velocity, which we do not need in WSS4J.</em>
+<a name="38" href="#38">38</a> <em class="jxr_javadoccomment"> */</em>
+<a name="39" href="#39">39</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/ws/security/saml/ext/OpenSAMLBootstrap.html">OpenSAMLBootstrap</a> <strong class="jxr_keyword">extends</strong> DefaultBootstrap {
+<a name="40" href="#40">40</a>
+<a name="41" href="#41">41</a> <em class="jxr_javadoccomment">/**</em><em class="jxr_javadoccomment"> List of default XMLTooling configuration files. */</em>
+<a name="42" href="#42">42</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> String[] xmlToolingConfigs = {
+<a name="43" href="#43">43</a> <span class="jxr_string">"/default-config.xml"</span>,
+<a name="44" href="#44">44</a> <span class="jxr_string">"/schema-config.xml"</span>,
+<a name="45" href="#45">45</a> <span class="jxr_string">"/signature-config.xml"</span>,
+<a name="46" href="#46">46</a> <span class="jxr_string">"/signature-validation-config.xml"</span>,
+<a name="47" href="#47">47</a> <span class="jxr_string">"/encryption-config.xml"</span>,
+<a name="48" href="#48">48</a> <span class="jxr_string">"/encryption-validation-config.xml"</span>,
+<a name="49" href="#49">49</a> <span class="jxr_string">"/soap11-config.xml"</span>,
+<a name="50" href="#50">50</a> <span class="jxr_string">"/wsfed11-protocol-config.xml"</span>,
+<a name="51" href="#51">51</a> <span class="jxr_string">"/saml1-assertion-config.xml"</span>,
+<a name="52" href="#52">52</a> <span class="jxr_string">"/saml1-protocol-config.xml"</span>,
+<a name="53" href="#53">53</a> <span class="jxr_string">"/saml1-core-validation-config.xml"</span>,
+<a name="54" href="#54">54</a> <span class="jxr_string">"/saml2-assertion-config.xml"</span>,
+<a name="55" href="#55">55</a> <span class="jxr_string">"/saml2-protocol-config.xml"</span>,
+<a name="56" href="#56">56</a> <span class="jxr_string">"/saml2-core-validation-config.xml"</span>,
+<a name="57" href="#57">57</a> <span class="jxr_string">"/saml1-metadata-config.xml"</span>,
+<a name="58" href="#58">58</a> <span class="jxr_string">"/saml2-metadata-config.xml"</span>,
+<a name="59" href="#59">59</a> <span class="jxr_string">"/saml2-metadata-validation-config.xml"</span>,
+<a name="60" href="#60">60</a> <span class="jxr_string">"/saml2-metadata-attr-config.xml"</span>,
+<a name="61" href="#61">61</a> <span class="jxr_string">"/saml2-metadata-idp-discovery-config.xml"</span>,
+<a name="62" href="#62">62</a> <span class="jxr_string">"/saml2-metadata-ui-config.xml"</span>,
+<a name="63" href="#63">63</a> <span class="jxr_string">"/saml2-protocol-thirdparty-config.xml"</span>,
+<a name="64" href="#64">64</a> <span class="jxr_string">"/saml2-metadata-query-config.xml"</span>,
+<a name="65" href="#65">65</a> <span class="jxr_string">"/saml2-assertion-delegation-restriction-config.xml"</span>,
+<a name="66" href="#66">66</a> <span class="jxr_string">"/saml2-ecp-config.xml"</span>,
+<a name="67" href="#67">67</a> <span class="jxr_string">"/saml2-xacml2-profile.xml"</span>,
+<a name="68" href="#68">68</a> <span class="jxr_string">"/xacml10-saml2-profile-config.xml"</span>,
+<a name="69" href="#69">69</a> <span class="jxr_string">"/xacml11-saml2-profile-config.xml"</span>,
+<a name="70" href="#70">70</a> <span class="jxr_string">"/xacml20-context-config.xml"</span>,
+<a name="71" href="#71">71</a> <span class="jxr_string">"/xacml20-policy-config.xml"</span>,
+<a name="72" href="#72">72</a> <span class="jxr_string">"/xacml2-saml2-profile-config.xml"</span>,
+<a name="73" href="#73">73</a> <span class="jxr_string">"/xacml3-saml2-profile-config.xml"</span>,
+<a name="74" href="#74">74</a> <span class="jxr_string">"/wsaddressing-config.xml"</span>,
+<a name="75" href="#75">75</a> <span class="jxr_string">"/wssecurity-config.xml"</span>,
+<a name="76" href="#76">76</a> };
+<a name="77" href="#77">77</a>
+<a name="78" href="#78">78</a> <em class="jxr_javadoccomment">/**</em>
+<a name="79" href="#79">79</a> <em class="jxr_javadoccomment"> * Initializes the OpenSAML library, loading default configurations.</em>
+<a name="80" href="#80">80</a> <em class="jxr_javadoccomment"> * </em>
+<a name="81" href="#81">81</a> <em class="jxr_javadoccomment"> * @throws ConfigurationException thrown if there is a problem initializing the OpenSAML library</em>
+<a name="82" href="#82">82</a> <em class="jxr_javadoccomment"> */</em>
+<a name="83" href="#83">83</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">synchronized</strong> <strong class="jxr_keyword">void</strong> bootstrap() <strong class="jxr_keyword">throws</strong> ConfigurationException {
+<a name="84" href="#84">84</a> initializeXMLSecurity();
+<a name="85" href="#85">85</a>
+<a name="86" href="#86">86</a> initializeXMLTooling(xmlToolingConfigs);
+<a name="87" href="#87">87</a>
+<a name="88" href="#88">88</a> initializeArtifactBuilderFactories();
+<a name="89" href="#89">89</a>
+<a name="90" href="#90">90</a> initializeGlobalSecurityConfiguration();
+<a name="91" href="#91">91</a>
+<a name="92" href="#92">92</a> initializeParserPool();
+<a name="93" href="#93">93</a> }
+<a name="94" href="#94">94</a>
+<a name="95" href="#95">95</a>
+<a name="96" href="#96">96</a> <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> initializeXMLTooling(String[] providerConfigs) <strong class="jxr_keyword">throws</strong> ConfigurationException {
+<a name="97" href="#97">97</a> XMLConfigurator configurator = <strong class="jxr_keyword">new</strong> XMLConfigurator();
+<a name="98" href="#98">98</a> <strong class="jxr_keyword">for</strong> (String config : providerConfigs) {
+<a name="99" href="#99">99</a> <em class="jxr_comment">//most are found in the Configuration.class classloader</em>
+<a name="100" href="#100">100</a> InputStream ins = Configuration.<strong class="jxr_keyword">class</strong>.getResourceAsStream(config);
+<a name="101" href="#101">101</a> <strong class="jxr_keyword">if</strong> (ins == <strong class="jxr_keyword">null</strong>) {
+<a name="102" href="#102">102</a> <em class="jxr_comment">//some are from us</em>
+<a name="103" href="#103">103</a> ins = OpenSAMLBootstrap.<strong class="jxr_keyword">class</strong>.getResourceAsStream(config);
+<a name="104" href="#104">104</a> }
+<a name="105" href="#105">105</a> configurator.load(ins);
+<a name="106" href="#106">106</a> }
+<a name="107" href="#107">107</a> }
+<a name="108" href="#108">108</a>
+<a name="109" href="#109">109</a> <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> initializeParserPool() <strong class="jxr_keyword">throws</strong> ConfigurationException {
+<a name="110" href="#110">110</a> StaticBasicParserPool pp = <strong class="jxr_keyword">new</strong> StaticBasicParserPool();
+<a name="111" href="#111">111</a> pp.setMaxPoolSize(50);
+<a name="112" href="#112">112</a>
+<a name="113" href="#113">113</a> Map<String, Boolean> features = <strong class="jxr_keyword">new</strong> HashMap<String, Boolean>();
+<a name="114" href="#114">114</a> features.put(XMLConstants.FEATURE_SECURE_PROCESSING, <strong class="jxr_keyword">true</strong>);
+<a name="115" href="#115">115</a> features.put(<span class="jxr_string">"http://apache.org/xml/features/disallow-doctype-decl"</span>, <strong class="jxr_keyword">true</strong>);
+<a name="116" href="#116">116</a> pp.setBuilderFeatures(features);
+<a name="117" href="#117">117</a> pp.setExpandEntityReferences(false);
+<a name="118" href="#118">118</a>
+<a name="119" href="#119">119</a> <strong class="jxr_keyword">try</strong> {
+<a name="120" href="#120">120</a> pp.initialize();
+<a name="121" href="#121">121</a> } <strong class="jxr_keyword">catch</strong> (XMLParserException e) {
+<a name="122" href="#122">122</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> ConfigurationException(<span class="jxr_string">"Error initializing parser pool"</span>, e);
+<a name="123" href="#123">123</a> }
+<a name="124" href="#124">124</a> Configuration.setParserPool(pp);
+<a name="125" href="#125">125</a> }
+<a name="126" href="#126">126</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/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-frame.html?rev=1556777&r1=1556776&r2=1556777&view=diff
==============================================================================
--- webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-frame.html (original)
+++ webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-frame.html Thu Jan 9 10:29:54 2014
@@ -3,7 +3,7 @@
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
- <title>Apache WSS4J 1.6.13 Reference Package org.apache.ws.security.saml.ext.bean</title>
+ <title>Apache WSS4J 1.6.14 Reference Package org.apache.ws.security.saml.ext.bean</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="style" />
</head>
<body>
Modified: webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-summary.html
URL: http://svn.apache.org/viewvc/webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-summary.html?rev=1556777&r1=1556776&r2=1556777&view=diff
==============================================================================
--- webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-summary.html (original)
+++ webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/bean/package-summary.html Thu Jan 9 10:29:54 2014
@@ -3,7 +3,7 @@
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
- <title>Apache WSS4J 1.6.13 Reference Package org.apache.ws.security.saml.ext.bean</title>
+ <title>Apache WSS4J 1.6.14 Reference Package org.apache.ws.security.saml.ext.bean</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="style" />
</head>
<body>
@@ -122,6 +122,6 @@
</ul>
</div>
<hr />
- Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.
+ Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.
</body>
</html>
\ No newline at end of file
Modified: webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/builder/package-frame.html
URL: http://svn.apache.org/viewvc/webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/builder/package-frame.html?rev=1556777&r1=1556776&r2=1556777&view=diff
==============================================================================
--- webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/builder/package-frame.html (original)
+++ webservices/website/wss4j/xref/org/apache/ws/security/saml/ext/builder/package-frame.html Thu Jan 9 10:29:54 2014
@@ -3,7 +3,7 @@
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
- <title>Apache WSS4J 1.6.13 Reference Package org.apache.ws.security.saml.ext.builder</title>
+ <title>Apache WSS4J 1.6.14 Reference Package org.apache.ws.security.saml.ext.builder</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="style" />
</head>
<body>