Class KeycloakKeySamlExtensionGenerator

java.lang.Object
org.keycloak.saml.processing.core.util.KeycloakKeySamlExtensionGenerator
All Implemented Interfaces:
SamlProtocolExtensionsAwareBuilder.NodeGenerator

public class KeycloakKeySamlExtensionGenerator extends Object implements SamlProtocolExtensionsAwareBuilder.NodeGenerator
Author:
hmlnarik
  • Field Details

  • Constructor Details

    • KeycloakKeySamlExtensionGenerator

      public KeycloakKeySamlExtensionGenerator(String keyId)
  • Method Details

    • write

      public void write(XMLStreamWriter writer) throws ProcessingException
      Description copied from interface: SamlProtocolExtensionsAwareBuilder.NodeGenerator
      Generate contents of the <samlp:Extensions> tag. When this method is invoked, the writer has already emitted the <samlp:Extensions> start tag.
      Specified by:
      write in interface SamlProtocolExtensionsAwareBuilder.NodeGenerator
      Parameters:
      writer - Writer to use for producing XML output
      Throws:
      ProcessingException - If any exception fails
    • getMessageSigningKeyIdFromElement

      public static String getMessageSigningKeyIdFromElement(Element element)
      Checks that the given element is indeed a Keycloak extension KeyInfo element and returns a content of MessageSigningKeyId attribute in the given element.
      Parameters:
      element - Element to obtain the key info from.
      Returns:
      null if the element is unknown or there is MessageSigningKeyId attribute unset, value of the MessageSigningKeyId attribute otherwise.