org.apache.ws.security.saml
Class SAML2Util

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

public class SAML2Util
extends Object


Field Summary
static boolean bootstrapped
          Extract certificates or the key available in the SAMLAssertion
 
Constructor Summary
SAML2Util()
           
 
Method Summary
static void doBootstrap()
           
static Set getClaims(org.opensaml.saml2.core.Assertion assertion)
          Extract the URIs of the set of claims available in a SAML 1.0/1.1 assertion.
static SAML2KeyInfo getSAML2KeyInfo(org.opensaml.saml2.core.Assertion assertion, Crypto crypto, CallbackHandler cb)
           
static SAML2KeyInfo getSAML2KeyInfo(Element elem, Crypto crypto, CallbackHandler cb)
           
static Timestamp getTimestampForSAMLAssertion(org.opensaml.saml2.core.Assertion assertion)
          Create a timestamp object from the SAML 2.0 Assertion
static void validateSignature(org.opensaml.saml2.core.Assertion assertion, Crypto crypto)
          Validate the signature of the SAML assertion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bootstrapped

public static boolean bootstrapped
Extract certificates or the key available in the SAMLAssertion

Constructor Detail

SAML2Util

public SAML2Util()
Method Detail

doBootstrap

public static void doBootstrap()
                        throws WSSecurityException
Throws:
WSSecurityException

getSAML2KeyInfo

public static SAML2KeyInfo getSAML2KeyInfo(Element elem,
                                           Crypto crypto,
                                           CallbackHandler cb)
                                    throws WSSecurityException
Throws:
WSSecurityException

getSAML2KeyInfo

public static SAML2KeyInfo getSAML2KeyInfo(org.opensaml.saml2.core.Assertion assertion,
                                           Crypto crypto,
                                           CallbackHandler cb)
                                    throws WSSecurityException
Throws:
WSSecurityException

getTimestampForSAMLAssertion

public static Timestamp getTimestampForSAMLAssertion(org.opensaml.saml2.core.Assertion assertion)
                                              throws WSSecurityException
Create a timestamp object from the SAML 2.0 Assertion

Parameters:
assertion -
Returns:
Throws:
WSSecurityException

getClaims

public static Set getClaims(org.opensaml.saml2.core.Assertion assertion)
Extract the URIs of the set of claims available in a SAML 1.0/1.1 assertion. This method will iterate through the set of AttributeStatements available and extract the namespaces of the claim.

Parameters:
assertion - SAML 2.0 Assertion
Returns:
TreeSet of claims contained in the SAML 2.0 assertion

validateSignature

public static void validateSignature(org.opensaml.saml2.core.Assertion assertion,
                                     Crypto crypto)
                              throws WSSecurityException
Validate the signature of the SAML assertion

Parameters:
assertion - SAML 2.0 assertion
crypto - Crypto object containing the certificate of the token issuer
Throws:
WSSecurityException - if the token does not contain certificate information, the certificate of the issuer is not trusted or the signature is invalid.


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