org.apache.ws.security.saml
Class SAMLUtil

java.lang.Object
  extended by org.apache.ws.security.saml.SAMLUtil

public class SAMLUtil
extends Object

Utility methods for SAML stuff


Constructor Summary
SAMLUtil()
           
 
Method Summary
static AssertionWrapper getAssertionFromKeyIdentifier(SecurityTokenReference secRef, Element strElement, RequestData request, WSDocInfo wsDocInfo)
          Get an AssertionWrapper object from parsing a SecurityTokenReference that uses a KeyIdentifier that points to a SAML Assertion.
static SAMLKeyInfo getCredentialFromKeyInfo(Element keyInfoElement, RequestData data, WSDocInfo docInfo, boolean bspCompliant)
          This method returns a SAMLKeyInfo corresponding to the credential found in the KeyInfo (DOM Element) argument.
static SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml1.core.Assertion assertion, RequestData data, WSDocInfo docInfo, boolean bspCompliant)
          Get the SAMLKeyInfo object corresponding to the credential stored in the Subject of a SAML 1.1 assertion
static SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml2.core.Assertion assertion, RequestData data, WSDocInfo docInfo, boolean bspCompliant)
          Get the SAMLKeyInfo object corresponding to the credential stored in the Subject of a SAML 2 assertion
static SAMLKeyInfo getCredentialFromSubject(AssertionWrapper assertion, RequestData data, WSDocInfo docInfo, boolean bspCompliant)
          Parse a SAML Assertion to obtain a SAMLKeyInfo object from the Subject of the assertion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMLUtil

public SAMLUtil()
Method Detail

getAssertionFromKeyIdentifier

public static AssertionWrapper getAssertionFromKeyIdentifier(SecurityTokenReference secRef,
                                                             Element strElement,
                                                             RequestData request,
                                                             WSDocInfo wsDocInfo)
                                                      throws WSSecurityException
Get an AssertionWrapper object from parsing a SecurityTokenReference that uses a KeyIdentifier that points to a SAML Assertion.

Parameters:
secRef - the SecurityTokenReference to the SAML Assertion
strElement - The SecurityTokenReference DOM element
request - The RequestData instance used to obtain configuration
wsDocInfo - The WSDocInfo object that holds previous results
Returns:
an AssertionWrapper object
Throws:
WSSecurityException

getCredentialFromSubject

public static SAMLKeyInfo getCredentialFromSubject(AssertionWrapper assertion,
                                                   RequestData data,
                                                   WSDocInfo docInfo,
                                                   boolean bspCompliant)
                                            throws WSSecurityException
Parse a SAML Assertion to obtain a SAMLKeyInfo object from the Subject of the assertion

Parameters:
assertion - The SAML Assertion
data - The RequestData instance used to obtain configuration
docInfo - A WSDocInfo instance
bspCompliant - Whether to process tokens in compliance with the BSP spec or not
Returns:
a SAMLKeyInfo object
Throws:
WSSecurityException

getCredentialFromSubject

public static SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml1.core.Assertion assertion,
                                                   RequestData data,
                                                   WSDocInfo docInfo,
                                                   boolean bspCompliant)
                                            throws WSSecurityException
Get the SAMLKeyInfo object corresponding to the credential stored in the Subject of a SAML 1.1 assertion

Parameters:
assertion - The SAML 1.1 assertion
data - The RequestData instance used to obtain configuration
docInfo - A WSDocInfo instance
bspCompliant - Whether to process tokens in compliance with the BSP spec or not
Returns:
The SAMLKeyInfo object obtained from the Subject
Throws:
WSSecurityException

getCredentialFromSubject

public static SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml2.core.Assertion assertion,
                                                   RequestData data,
                                                   WSDocInfo docInfo,
                                                   boolean bspCompliant)
                                            throws WSSecurityException
Get the SAMLKeyInfo object corresponding to the credential stored in the Subject of a SAML 2 assertion

Parameters:
assertion - The SAML 2 assertion
data - The RequestData instance used to obtain configuration
docInfo - A WSDocInfo instance
bspCompliant - Whether to process tokens in compliance with the BSP spec or not
Returns:
The SAMLKeyInfo object obtained from the Subject
Throws:
WSSecurityException

getCredentialFromKeyInfo

public static SAMLKeyInfo getCredentialFromKeyInfo(Element keyInfoElement,
                                                   RequestData data,
                                                   WSDocInfo docInfo,
                                                   boolean bspCompliant)
                                            throws WSSecurityException
This method returns a SAMLKeyInfo corresponding to the credential found in the KeyInfo (DOM Element) argument.

Parameters:
keyInfoElement - The KeyInfo as a DOM Element
data - The RequestData instance used to obtain configuration
docInfo - A WSDocInfo instance
bspCompliant - Whether to process tokens in compliance with the BSP spec or not
Returns:
The credential (as a SAMLKeyInfo object)
Throws:
WSSecurityException


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.