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 Summary
Fields Modifier and Type Field Description static String
KC_KEY_INFO_ELEMENT_NAME
static String
KEY_ID_ATTRIBUTE_NAME
static String
NS_PREFIX
static String
NS_URI
-
Constructor Summary
Constructors Constructor Description KeycloakKeySamlExtensionGenerator(String keyId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getMessageSigningKeyIdFromElement(Element element)
Checks that the given element is indeed a Keycloak extensionKeyInfo
element and returns a content ofMessageSigningKeyId
attribute in the given element.void
write(XMLStreamWriter writer)
Generate contents of the <samlp:Extensions> tag.
-
-
-
Field Detail
-
NS_URI
public static final String NS_URI
- See Also:
- Constant Field Values
-
NS_PREFIX
public static final String NS_PREFIX
- See Also:
- Constant Field Values
-
KC_KEY_INFO_ELEMENT_NAME
public static final String KC_KEY_INFO_ELEMENT_NAME
- See Also:
- Constant Field Values
-
KEY_ID_ATTRIBUTE_NAME
public static final String KEY_ID_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KeycloakKeySamlExtensionGenerator
public KeycloakKeySamlExtensionGenerator(String keyId)
-
-
Method Detail
-
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 interfaceSamlProtocolExtensionsAwareBuilder.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 extensionKeyInfo
element and returns a content ofMessageSigningKeyId
attribute in the given element.- Parameters:
element
- Element to obtain the key info from.- Returns:
null
if the element is unknown or there isMessageSigningKeyId
attribute unset, value of theMessageSigningKeyId
attribute otherwise.
-
-