Search in sources :

Example 1 with KeyStoreConfig

use of org.keycloak.adapters.saml.config.Key.KeyStoreConfig in project keycloak by keycloak.

the class KeyStoreParser method instantiateElement.

@Override
protected KeyStoreConfig instantiateElement(XMLEventReader xmlEventReader, StartElement element) throws ParsingException {
    final KeyStoreConfig keyStore = new Key.KeyStoreConfig();
    keyStore.setType(StaxParserUtil.getAttributeValueRP(element, KeycloakSamlAdapterV1QNames.ATTR_TYPE));
    keyStore.setAlias(StaxParserUtil.getAttributeValueRP(element, KeycloakSamlAdapterV1QNames.ATTR_ALIAS));
    keyStore.setFile(StaxParserUtil.getAttributeValueRP(element, KeycloakSamlAdapterV1QNames.ATTR_FILE));
    keyStore.setResource(StaxParserUtil.getAttributeValueRP(element, KeycloakSamlAdapterV1QNames.ATTR_RESOURCE));
    keyStore.setPassword(StaxParserUtil.getRequiredAttributeValueRP(element, KeycloakSamlAdapterV1QNames.ATTR_PASSWORD));
    if (keyStore.getFile() == null && keyStore.getResource() == null) {
        throw new ParsingException("KeyStore element must have the url or classpath attribute set");
    }
    return keyStore;
}
Also used : ParsingException(org.keycloak.saml.common.exceptions.ParsingException) KeyStoreConfig(org.keycloak.adapters.saml.config.Key.KeyStoreConfig)

Aggregations

KeyStoreConfig (org.keycloak.adapters.saml.config.Key.KeyStoreConfig)1 ParsingException (org.keycloak.saml.common.exceptions.ParsingException)1