PicketLink Federation Core 2.1.6.Final-redhat-2

org.picketlink.identity.federation.web.util
Class RedirectBindingSignatureUtil

java.lang.Object
  extended by org.picketlink.identity.federation.web.util.RedirectBindingSignatureUtil

public class RedirectBindingSignatureUtil
extends Object

Signature Support for the HTTP/Redirect binding

Since:
Dec 16, 2008
Author:
Anil.Saldhana@redhat.com

Constructor Summary
RedirectBindingSignatureUtil()
           
 
Method Summary
static AuthnRequestType getRequestFromSignedURL(String signedURL)
          From the SAML Request URL, get the Request object
static String getSAMLRequestURLWithSignature(AuthnRequestType authRequest, String relayState, PrivateKey signingKey)
          Get the URL for the SAML request that contains the signature and signature algorithm
static String getSAMLRequestURLWithSignature(String urlEncodedRequest, String urlEncodedRelayState, PrivateKey signingKey)
          Given an url-encoded saml request and relay state and a private key, compute the url
static String getSAMLResponseURLWithSignature(ResponseType responseType, String relayState, PrivateKey signingKey)
          Get the URL for the SAML request that contains the signature and signature algorithm
static String getSAMLResponseURLWithSignature(String urlEncodedResponse, String urlEncodedRelayState, PrivateKey signingKey)
          Given an url-encoded saml response and relay state and a private key, compute the url
static byte[] getSignatureValueFromSignedURL(String signedURL)
          Get the signature value from the url
static String getTokenValue(String queryString, String token)
          From the query string that contains key/value pairs, get the value of a key Note: if the token is null, a null value is returned
static boolean validateSignature(String queryString, PublicKey validatingKey, byte[] sigValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedirectBindingSignatureUtil

public RedirectBindingSignatureUtil()
Method Detail

getSAMLRequestURLWithSignature

public static String getSAMLRequestURLWithSignature(AuthnRequestType authRequest,
                                                    String relayState,
                                                    PrivateKey signingKey)
                                             throws SAXException,
                                                    IOException,
                                                    GeneralSecurityException
Get the URL for the SAML request that contains the signature and signature algorithm

Parameters:
authRequest -
relayState -
signingKey -
Returns:
Throws:
SAXException
IOException
GeneralSecurityException

getSAMLResponseURLWithSignature

public static String getSAMLResponseURLWithSignature(ResponseType responseType,
                                                     String relayState,
                                                     PrivateKey signingKey)
                                              throws IOException,
                                                     GeneralSecurityException
Get the URL for the SAML request that contains the signature and signature algorithm

Parameters:
responseType -
relayState -
signingKey -
Returns:
Throws:
IOException
GeneralSecurityException

getSAMLRequestURLWithSignature

public static String getSAMLRequestURLWithSignature(String urlEncodedRequest,
                                                    String urlEncodedRelayState,
                                                    PrivateKey signingKey)
                                             throws IOException,
                                                    GeneralSecurityException
Given an url-encoded saml request and relay state and a private key, compute the url

Parameters:
urlEncodedRequest -
urlEncodedRelayState -
signingKey -
Returns:
Throws:
GeneralSecurityException
IOException

getSAMLResponseURLWithSignature

public static String getSAMLResponseURLWithSignature(String urlEncodedResponse,
                                                     String urlEncodedRelayState,
                                                     PrivateKey signingKey)
                                              throws IOException,
                                                     GeneralSecurityException
Given an url-encoded saml response and relay state and a private key, compute the url

Parameters:
urlEncodedResponse -
urlEncodedRelayState -
signingKey -
Returns:
Throws:
GeneralSecurityException
IOException

getRequestFromSignedURL

public static AuthnRequestType getRequestFromSignedURL(String signedURL)
                                                throws ConfigurationException,
                                                       ProcessingException,
                                                       ParsingException,
                                                       IOException
From the SAML Request URL, get the Request object

Parameters:
signedURL -
Returns:
Throws:
IOException
ParsingException
ProcessingException
ConfigurationException

getSignatureValueFromSignedURL

public static byte[] getSignatureValueFromSignedURL(String signedURL)
                                             throws IOException
Get the signature value from the url

Parameters:
signedURL -
Returns:
Throws:
IOException

getTokenValue

public static String getTokenValue(String queryString,
                                   String token)
From the query string that contains key/value pairs, get the value of a key Note: if the token is null, a null value is returned

Parameters:
queryString -
token -
Returns:

validateSignature

public static boolean validateSignature(String queryString,
                                        PublicKey validatingKey,
                                        byte[] sigValue)
                                 throws UnsupportedEncodingException,
                                        GeneralSecurityException
Throws:
UnsupportedEncodingException
GeneralSecurityException

PicketLink Federation Core 2.1.6.Final-redhat-2

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.