Class DefaultCredentialBundleRegistry
java.lang.Object
se.swedenconnect.security.credential.bundle.DefaultCredentialBundleRegistry
- All Implemented Interfaces:
CredentialBundleRegistry
,CredentialBundles
public class DefaultCredentialBundleRegistry
extends Object
implements CredentialBundleRegistry, CredentialBundles
Default implementation of the
CredentialBundles
and CredentialBundleRegistry
interfaces.- Author:
- Martin Lindström
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCredential
(String id) Gets thePkiCredential
registered under the given ID.getKeyStore
(String id) Gets theKeyStore
registered under the given ID.Gets a list of all ID:s for registered credentials.Gets a list of all ID:s for registered key stores.void
registerCredential
(String id, PkiCredential credential) Registers a credential.void
registerKeyStore
(String id, KeyStore keyStore) Registers a key store.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.swedenconnect.security.credential.bundle.CredentialBundles
getCredentialProvider, getKeyStoreProvider
-
Constructor Details
-
DefaultCredentialBundleRegistry
public DefaultCredentialBundleRegistry()
-
-
Method Details
-
registerCredential
public void registerCredential(@Nonnull String id, @Nonnull PkiCredential credential) throws IllegalArgumentException Registers a credential.- Specified by:
registerCredential
in interfaceCredentialBundleRegistry
- Parameters:
id
- the unique credential IDcredential
- thePkiCredential
to register- Throws:
IllegalArgumentException
- if another credential already has been registered under the given ID
-
registerKeyStore
Registers a key store.- Specified by:
registerKeyStore
in interfaceCredentialBundleRegistry
- Parameters:
id
- the unique key store ID.keyStore
- theKeyStore
to register.
-
getCredential
Gets thePkiCredential
registered under the given ID.- Specified by:
getCredential
in interfaceCredentialBundles
- Parameters:
id
- the unique credential ID- Returns:
- a
PkiCredential
- Throws:
NoSuchCredentialException
- if no credential is registered under the given ID
-
getRegisteredCredentials
Gets a list of all ID:s for registered credentials.- Specified by:
getRegisteredCredentials
in interfaceCredentialBundles
- Returns:
- a list of all ID:s for registered credentials
-
getKeyStore
Gets theKeyStore
registered under the given ID.- Specified by:
getKeyStore
in interfaceCredentialBundles
- Parameters:
id
- the unique key store ID- Returns:
- a
KeyStore
- Throws:
NoSuchKeyStoreException
- if no key store is registered under the given ID
-
getRegisteredKeyStores
Gets a list of all ID:s for registered key stores.- Specified by:
getRegisteredKeyStores
in interfaceCredentialBundles
- Returns:
- a list of all ID:s for registered key stores
-