Class BasicX509CredentialFactoryBean
- java.lang.Object
-
- org.springframework.beans.factory.config.AbstractFactoryBean<T>
-
- net.shibboleth.ext.spring.factory.AbstractComponentAwareFactoryBean<T>
-
- net.shibboleth.idp.profile.spring.factory.AbstractCredentialFactoryBean<BasicX509Credential>
-
- net.shibboleth.idp.profile.spring.factory.AbstractX509CredentialFactoryBean
-
- net.shibboleth.idp.profile.spring.factory.BasicX509CredentialFactoryBean
-
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<BasicX509Credential>,InitializingBean
public class BasicX509CredentialFactoryBean extends AbstractX509CredentialFactoryBean
Spring bean factory for producing aBasicX509CredentialfromResources.This factory bean supports DER and PEM encoded certificate resources and encrypted and non-encrypted PKCS8, DER, or PEM encoded private key resources.
-
-
Field Summary
Fields Modifier and Type Field Description private List<Resource>certificateResourcesWhere the certificates are to be found.private List<Resource>crlResourcesWhere the crls are to be found.private ResourceentityResourceThe specification of where the entity Resource is to be found.private org.slf4j.Loggerloglog.private ResourceprivateKeyResourceWhere the private key is to be found.-
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description BasicX509CredentialFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<X509Certificate>getCertificates()Get the configured certificates.protected List<X509CRL>getCRLs()Get the configured CRL list.protected X509CertificategetEntityCertificate()return the explicitly configured entity certificate.protected PrivateKeygetPrivateKey()Get the configured private key.booleanisSingleton()voidsetCertificateResource(Resource res)Set the certificate resource.voidsetCertificates(List<Resource> what)Sets the Resources which contain the certificates.voidsetCRLs(List<Resource> what)Sets the Resources which contain the crls.voidsetEntity(Resource what)Set the Resource with the entity certificate.voidsetEntityId(String id)Set the entityID for the credential.voidsetPrivateKey(Resource what)Set the Resource with the entity certificate.voidsetPrivateKeyPassword(String password)Set the password for the private key.voidsetPrivateKeyResource(Resource res)Set the resource containing the private key.-
Methods inherited from class net.shibboleth.idp.profile.spring.factory.AbstractX509CredentialFactoryBean
doCreateInstance, getObjectType
-
Methods inherited from class net.shibboleth.idp.profile.spring.factory.AbstractCredentialFactoryBean
getConfigDescription, getEntityID, getKeyNames, getPrivateKeyPassword, getUsageType, setConfigDescription, setEntityID, setKeyNames, setPrivateKeyPassword, setUsageType
-
Methods inherited from class net.shibboleth.ext.spring.factory.AbstractComponentAwareFactoryBean
createInstance, destroyInstance
-
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, setBeanClassLoader, setBeanFactory, setSingleton
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
log.
-
entityResource
private Resource entityResource
The specification of where the entity Resource is to be found.
-
certificateResources
private List<Resource> certificateResources
Where the certificates are to be found.
-
privateKeyResource
private Resource privateKeyResource
Where the private key is to be found.
-
-
Method Detail
-
setEntity
public void setEntity(@Nonnull Resource what)Set the Resource with the entity certificate.- Parameters:
what- The Resource to set.
-
setCertificates
public void setCertificates(@Nullable @NotEmpty List<Resource> what)
Sets the Resources which contain the certificates.- Parameters:
what- The values to set.
-
setPrivateKey
public void setPrivateKey(@Nullable Resource what)Set the Resource with the entity certificate.- Parameters:
what- The resource to set.
-
setCRLs
public void setCRLs(@Nullable @NotEmpty List<Resource> what)
Sets the Resources which contain the crls.- Parameters:
what- The value to set.
-
setPrivateKeyResource
public void setPrivateKeyResource(@Nonnull Resource res)Set the resource containing the private key.- Parameters:
res- private key resource, nevernull
-
setPrivateKeyPassword
public void setPrivateKeyPassword(@Nullable String password)Set the password for the private key.- Parameters:
password- password for the private key, may be null if the key is not encrypted
-
setCertificateResource
public void setCertificateResource(@Nonnull Resource res)Set the certificate resource.- Parameters:
res- certificate resource
-
setEntityId
public void setEntityId(@Nullable String id)Set the entityID for the credential.- Parameters:
id- entityID
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceFactoryBean<BasicX509Credential>- Overrides:
isSingletonin classAbstractFactoryBean<BasicX509Credential>
-
getEntityCertificate
@Nullable protected X509Certificate getEntityCertificate()
return the explicitly configured entity certificate..- Specified by:
getEntityCertificatein classAbstractX509CredentialFactoryBean- Returns:
- the certificate, or none if not configured.
-
getCertificates
@Nonnull protected List<X509Certificate> getCertificates()
Get the configured certificates. This MUST include the entity certificate if it was configured.- Specified by:
getCertificatesin classAbstractX509CredentialFactoryBean- Returns:
- the certificates.
-
getPrivateKey
@Nullable protected PrivateKey getPrivateKey()
Get the configured private key.- Specified by:
getPrivateKeyin classAbstractX509CredentialFactoryBean- Returns:
- the key or null if non configured
-
getCRLs
@Nullable protected List<X509CRL> getCRLs()
Get the configured CRL list.- Specified by:
getCRLsin classAbstractX509CredentialFactoryBean- Returns:
- the crls or null
-
-