Class X509KeyStoreStorageServiceResolver
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.sp.credential.AbstractOrderedCredentialResolver
net.shibboleth.sp.credential.AbstractStorageServiceCredentialResolver<X509Credential>
net.shibboleth.sp.credential.impl.X509KeyStoreStorageServiceResolver
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<Credential,,CriteriaSet> OrderedCredentialResolver,CredentialResolver,Ordered
public class X509KeyStoreStorageServiceResolver
extends AbstractStorageServiceCredentialResolver<X509Credential>
A specialized storage-based resolver that can resolve the
X509Credential type
from a KeyStore, typically though not inherently the "PKCS12" type.
Additional settings are required to specify how to locate the various components such as the keystore data and alias to use. A keystore password may be configured but must be usable for any resolved keys.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.shibboleth.sp.credential.AbstractOrderedCredentialResolver
AbstractOrderedCredentialResolver.UsageCriterionPredicate -
Field Summary
FieldsModifier and TypeFieldDescription(package private) TemplateVelocity template for certificate storage key.private StringTemplate used to construct the keystore alias to load.(package private) TemplateVelocity template for keystore storage key.private StringTemplate used to construct the storage key for the keystore.private StringKeystore type.private final org.slf4j.LoggerClass logger.private char[]Password for private key(s).Fields inherited from class net.shibboleth.sp.credential.AbstractStorageServiceCredentialResolver
CONTEXT_KEY_AGENT_ID, CONTEXT_KEY_APPLICATION_ID, CONTEXT_KEY_CRITERIA, CONTEXT_KEY_ENTITY_ID, CONTEXT_KEY_PRC, CONTEXT_KEY_PROTOCOL, CONTEXT_KEY_TX_ENTITY_ID, CONTEXT_KEY_USAGE, DEFAULT_CONTEXT_PREFIXFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected Iterable<Credential>doResolve(org.apache.velocity.VelocityContext velocityContext, CriteriaSet criteria, String storageContext) Perform the resolution as required for the specific type ofCredential.voidsetAliasTemplate(String template) Sets the Velocity template string for theKeyStorealias to load.voidsetKeyStoreTemplate(String template) Sets the Velocity template string for the keystore's storage key.voidsetKeyStoreType(String type) Sets theKeyStoretype.voidsetPassword(String password) Sets the password to apply to the keystore and any resolved entries.Methods inherited from class net.shibboleth.sp.credential.AbstractStorageServiceCredentialResolver
doResolve, getStorageService, getVelocityEngine, populateVelocityContext, setCacheEnabled, setContextTemplate, setEntityIDTransformStrategy, setExpireAfterAccess, setExpireAfterWrite, setMaximumCachedElements, setProtocolMap, setStorageService, setUsageMap, setVelocityEngineMethods inherited from class net.shibboleth.sp.credential.AbstractOrderedCredentialResolver
getOrder, resolve, resolveSingle, setFilterByUsage, setOrder, setProtocolsMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
keyStoreType
Keystore type. -
keyStoreTemplateString
Template used to construct the storage key for the keystore. -
aliasTemplateString
Template used to construct the keystore alias to load. -
privateKeyPassword
@Nullable private char[] privateKeyPasswordPassword for private key(s). -
keyStoreTemplate
Velocity template for keystore storage key. -
aliasTemplate
Velocity template for certificate storage key.
-
-
Constructor Details
-
X509KeyStoreStorageServiceResolver
public X509KeyStoreStorageServiceResolver()Constructor.
-
-
Method Details
-
setKeyStoreType
Sets theKeyStoretype.Defaults to "PKCS12".
- Parameters:
type- keystore type
-
setKeyStoreTemplate
Sets the Velocity template string for the keystore's storage key.Defaults to "sp-keystore.p12", which punts any other decoration to the storage context and assumes a fixed keystore with potentially multiple key entries.
- Parameters:
template- template string
-
setAliasTemplate
Sets the Velocity template string for theKeyStorealias to load.Defaults to "${agentID}${usage}", which assumes per-Agent entries discriminated by usage.
- Parameters:
template- template string
-
setPassword
Sets the password to apply to the keystore and any resolved entries.- Parameters:
password- keystore password
-
doInitialize
- Overrides:
doInitializein classAbstractStorageServiceCredentialResolver<X509Credential>- Throws:
ComponentInitializationException
-