org.apache.wss4j.common.saml
Class SAMLUtil

java.lang.Object
  extended by org.apache.wss4j.common.saml.SAMLUtil

public final class SAMLUtil
extends Object

Utility methods for SAML stuff


Method Summary
static void doSAMLCallback(CallbackHandler callbackHandler, SAMLCallback callback)
           
static SAMLKeyInfo getCredentialFromKeyInfo(Element keyInfoElement, SAMLKeyInfoProcessor keyInfoProcessor, Crypto sigCrypto)
          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, SAMLKeyInfoProcessor keyInfoProcessor, Crypto sigCrypto, CallbackHandler callbackHandler)
          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, SAMLKeyInfoProcessor keyInfoProcessor, Crypto sigCrypto, CallbackHandler callbackHandler)
          Get the SAMLKeyInfo object corresponding to the credential stored in the Subject of a SAML 2 assertion
static SAMLKeyInfo getCredentialFromSubject(SamlAssertionWrapper samlAssertion, SAMLKeyInfoProcessor keyInfoProcessor, Crypto sigCrypto, CallbackHandler callbackHandler)
          Parse a SAML Assertion to obtain a SAMLKeyInfo object from the Subject of the assertion
static byte[] getSecretKeyFromCallbackHandler(String id, CallbackHandler cb)
          Try to get the secret key from a CallbackHandler implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCredentialFromSubject

public static SAMLKeyInfo getCredentialFromSubject(SamlAssertionWrapper samlAssertion,
                                                   SAMLKeyInfoProcessor keyInfoProcessor,
                                                   Crypto sigCrypto,
                                                   CallbackHandler callbackHandler)
                                            throws WSSecurityException
Parse a SAML Assertion to obtain a SAMLKeyInfo object from the Subject of the assertion

Parameters:
samlAssertion - The SAML Assertion
keyInfoProcessor - A pluggable way to parse the KeyInfo
Returns:
a SAMLKeyInfo object
Throws:
WSSecurityException

getSecretKeyFromCallbackHandler

public static byte[] getSecretKeyFromCallbackHandler(String id,
                                                     CallbackHandler cb)
Try to get the secret key from a CallbackHandler implementation

Parameters:
cb - a CallbackHandler implementation
Returns:
An array of bytes corresponding to the secret key (can be null)

getCredentialFromSubject

public static SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml1.core.Assertion assertion,
                                                   SAMLKeyInfoProcessor keyInfoProcessor,
                                                   Crypto sigCrypto,
                                                   CallbackHandler callbackHandler)
                                            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
keyInfoProcessor - A pluggable way to parse the KeyInfo
sigCrypto - A Crypto instance
callbackHandler - A CallbackHandler instance
Returns:
The SAMLKeyInfo object obtained from the Subject
Throws:
WSSecurityException

getCredentialFromSubject

public static SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml2.core.Assertion assertion,
                                                   SAMLKeyInfoProcessor keyInfoProcessor,
                                                   Crypto sigCrypto,
                                                   CallbackHandler callbackHandler)
                                            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
keyInfoProcessor - A pluggable way to parse the KeyInfo
sigCrypto - A Crypto instance
callbackHandler - A CallbackHandler instance
Returns:
The SAMLKeyInfo object obtained from the Subject
Throws:
WSSecurityException

getCredentialFromKeyInfo

public static SAMLKeyInfo getCredentialFromKeyInfo(Element keyInfoElement,
                                                   SAMLKeyInfoProcessor keyInfoProcessor,
                                                   Crypto sigCrypto)
                                            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
keyInfoProcessor - A pluggable way to parse the KeyInfo
sigCrypto - A Crypto instance
Returns:
The credential (as a SAMLKeyInfo object)
Throws:
WSSecurityException

doSAMLCallback

public static void doSAMLCallback(CallbackHandler callbackHandler,
                                  SAMLCallback callback)


Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.