public final class KeyStoreCredentialSource extends Object implements CredentialSource
NONE
Constructor and Description |
---|
KeyStoreCredentialSource(KeyStore keyStore,
String alias,
KeyStore.ProtectionParameter protectionParameter)
Construct a new instance.
|
KeyStoreCredentialSource(SecurityFactory<KeyStore.Entry> entryFactory)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
<C extends Credential> |
getCredential(Class<C> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Acquire a credential of the given type.
|
SupportLevel |
getCredentialAcquireSupport(Class<? extends Credential> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Determine whether a given credential is definitely obtainable, possibly obtainable, or definitely not obtainable.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyToCredential, applyToCredential, applyToCredential, fromSecurityFactory, getCredential, getCredential, getCredentialAcquireSupport, getCredentialAcquireSupport, with, without, without, without
public KeyStoreCredentialSource(KeyStore keyStore, String alias, KeyStore.ProtectionParameter protectionParameter)
keyStore
- the key store to reference (must not be null
)alias
- the name of the key store entry to read from (must not be null
)protectionParameter
- the protection parameter to use to access the key store entry, or null
for nonepublic KeyStoreCredentialSource(SecurityFactory<KeyStore.Entry> entryFactory)
entryFactory
- the entry factory to use to instantiate the entry (must not be null
)public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws IOException
CredentialSource
getCredentialAcquireSupport
in interface CredentialSource
credentialType
- the credential type class (must not be null
)algorithmName
- the algorithm name, or null
if any algorithm is acceptable or the credential type does
not support algorithm namesparameterSpec
- the algorithm parameters to match, or null
if any parameters are acceptable or the credential type
does not support algorithm parametersnull
)IOException
- if the credential source failed to determine the support levelpublic <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws IOException
CredentialSource
Class
and an optional algorithmName
. If the
algorithm name is not given, then the query is performed for any algorithm of the given type.getCredential
in interface CredentialSource
C
- the credential typecredentialType
- the credential type class (must not be null
)algorithmName
- the algorithm name, or null
if any algorithm is acceptable or the credential type does
not support algorithm namesparameterSpec
- the algorithm parameters to match, or null
if any parameters are acceptable or the credential type
does not support algorithm parametersnull
if the principal has no credential of that typeIOException
- if the realm is not able to handle requests for any reasonCopyright © 2017 JBoss by Red Hat. All rights reserved.