org.keycloak.protocol.saml

## Class SamlProtocolUtils

- java.lang.Object
- - org.keycloak.protocol.saml.SamlProtocolUtils

-     public class SamlProtocolUtils
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SamlProtocolUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PublicKey` | `getEncryptionKey(ClientModel client)` Returns public part of SAML encryption key from the client settings.
    `static PublicKey` | `getPublicKey(ClientModel client, String attribute)`
    `static PublicKey` | `getSignatureValidationKey(ClientModel client)` Returns public part of SAML signing key from the client settings.
    `static void` | `verifyDocumentSignature(ClientModel client, Document document)` Verifies a signature of the given SAML document using settings for the given client.
    `static void` | `verifyDocumentSignature(Document document, KeyLocator keyLocator)` Verifies a signature of the given SAML document using keys obtained from the given key locator.
    `static void` | `verifyRedirectSignature(SAMLDocumentHolder documentHolder, KeyLocator locator, javax.ws.rs.core.MultivaluedMap<String,String> encodedParams, String paramKey)`
    `static void` | `verifyRedirectSignature(SAMLDocumentHolder documentHolder, KeyLocator locator, javax.ws.rs.core.UriInfo uriInformation, String paramKey)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SamlProtocolUtils

          public SamlProtocolUtils()

  - ### Method Detail

    - #### verifyDocumentSignature

          public static void verifyDocumentSignature(ClientModel client,
                                                     Document document)
                                              throws VerificationException

      Verifies a signature of the given SAML document using settings for the given client. Throws an exception if the client signature is expected to be present as per the client settings and it is invalid, otherwise returns back to the caller.
      Parameters:
        `client` -
        `document` -
      Throws:
        `VerificationException`

    - #### verifyDocumentSignature

          public static void verifyDocumentSignature(Document document,
                                                     KeyLocator keyLocator)
                                              throws VerificationException

      Verifies a signature of the given SAML document using keys obtained from the given key locator. Throws an exception if the client signature is invalid, otherwise returns back to the caller.
      Parameters:
        `document` -
        `keyLocator` -
      Throws:
        `VerificationException`

    - #### getSignatureValidationKey

          public static PublicKey getSignatureValidationKey(ClientModel client)
                                                     throws VerificationException

      Returns public part of SAML signing key from the client settings.
      Parameters:
        `client` -
      Returns:
        Public key for signature validation.
      Throws:
        `VerificationException`

    - #### getEncryptionKey

          public static PublicKey getEncryptionKey(ClientModel client)
                                            throws VerificationException

      Returns public part of SAML encryption key from the client settings.
      Parameters:
        `client` -
      Returns:
        Public key for encryption.
      Throws:
        `VerificationException`

    - #### getPublicKey

          public static PublicKey getPublicKey(ClientModel client,
                                               String attribute)
                                        throws VerificationException

      Throws:
        `VerificationException`

    - #### verifyRedirectSignature

          public static void verifyRedirectSignature(SAMLDocumentHolder documentHolder,
                                                     KeyLocator locator,
                                                     javax.ws.rs.core.UriInfo uriInformation,
                                                     String paramKey)
                                              throws VerificationException

      Throws:
        `VerificationException`

    - #### verifyRedirectSignature

          public static void verifyRedirectSignature(SAMLDocumentHolder documentHolder,
                                                     KeyLocator locator,
                                                     javax.ws.rs.core.MultivaluedMap<String,String> encodedParams,
                                                     String paramKey)
                                              throws VerificationException

      Throws:
        `VerificationException`

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