Class ConfigurationCredentialBundleRegistrar
java.lang.Object
se.swedenconnect.security.credential.bundle.ConfigurationCredentialBundleRegistrar
- All Implemented Interfaces:
CredentialBundleRegistrar
public class ConfigurationCredentialBundleRegistrar
extends Object
implements CredentialBundleRegistrar
A
CredentialBundleRegistrar implementation that registers credentials and key stores based on a configuration
object.- Author:
- Martin Lindström
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor using aDefaultConfigurationResourceLoaderto load resources.ConfigurationCredentialBundleRegistrar(CredentialBundlesConfiguration configuration, ConfigurationResourceLoader resourceLoader) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidloadConfiguration(CredentialBundlesConfiguration configuration, ConfigurationResourceLoader resourceLoader, CredentialBundleRegistry registry) Utility method for loading the supplied configuration and registering key stores and credentials at the supplied registry.voidregister(CredentialBundleRegistry registry)
-
Constructor Details
-
ConfigurationCredentialBundleRegistrar
public ConfigurationCredentialBundleRegistrar(@Nonnull CredentialBundlesConfiguration configuration) Constructor using aDefaultConfigurationResourceLoaderto load resources. Spring and Quarkus users should implement their own resource loaders.- Parameters:
configuration- the configuration to use when registering credentials and key stores
-
ConfigurationCredentialBundleRegistrar
public ConfigurationCredentialBundleRegistrar(@Nonnull CredentialBundlesConfiguration configuration, @Nonnull ConfigurationResourceLoader resourceLoader) Constructor.- Parameters:
configuration- the configuration to use when registering credentials and key storesresourceLoader- the resource loader for reading resources referenced in the configuration
-
-
Method Details
-
loadConfiguration
public static void loadConfiguration(@Nonnull CredentialBundlesConfiguration configuration, @Nullable ConfigurationResourceLoader resourceLoader, @Nonnull CredentialBundleRegistry registry) throws IllegalArgumentException Utility method for loading the supplied configuration and registering key stores and credentials at the supplied registry.- Parameters:
configuration- the configuration to use when registering credentials and key storesresourceLoader- the resource loader for reading resources referenced in the configuration, ifnull, aDefaultConfigurationResourceLoaderwill be usedregistry- the registry to update- Throws:
IllegalArgumentException- for invalid registration/configuration data
-
register
- Specified by:
registerin interfaceCredentialBundleRegistrar- Parameters:
registry- the registry that accepts registrations- Throws:
IllegalArgumentException- for invalid registration/configuration data
-