org.keycloak.saml.processing.web.util

## Class RedirectBindingSignatureUtil

- java.lang.Object
- - org.keycloak.saml.processing.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

    Constructors
    Constructor and Description
    `RedirectBindingSignatureUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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`

Copyright © 2016 JBoss by Red Hat. All rights reserved.