Class HTTPResourceFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<HTTPResource>
net.shibboleth.idp.profile.spring.resource.impl.HTTPResourceFactoryBean
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<HTTPResource>
,InitializingBean
Factory bean for simple use cases that auto-configure PKIX or key pinning for
an
HTTPResource
.- Since:
- 3.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Backing file path.The resources to be turned into certificates.private org.apache.http.client.HttpClient
HTTP Client used to pull the resource.private HttpClientContextHandler
Optional handler to pre- and post-process context.The resources to be turned into keys.private org.slf4j.Logger
Class logger.private URL
URL to the Resource.private boolean
Use a PKIX trust engine.private Integer
PKIX verify depth.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 -
Method Summary
Modifier and TypeMethodDescriptionprotected HTTPResource
protected List<X509Certificate>
Get the configured certificates in their native form.protected List<Credential>
Get the configured keys and certificates lumped together as credentials.Class<?>
void
setBackingResource
(String resource) Set the backing resource.void
setCertificates
(List<Resource> certs) Set the resources which we will convert into certificates.void
setHttpClient
(org.apache.http.client.HttpClient client) Set theHttpClient
instance.void
Set a handler to manipulate theHttpClientContext
.void
setPublicKeys
(List<Resource> keys) Set the resources which we will convert into certificates.void
Set the URL.void
setUsePKIX
(boolean flag) Set whether to use a PKIX trust engine.void
setVerifyDepth
(Integer depth) Set the verify depth.Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
backingResource
Backing file path. -
httpClient
@Nullable private org.apache.http.client.HttpClient httpClientHTTP Client used to pull the resource. -
resourceURL
URL to the Resource. -
httpClientContextHandler
Optional handler to pre- and post-process context. -
keyResources
The resources to be turned into keys. -
certificateResources
The resources to be turned into certificates. -
usePKIX
private boolean usePKIXUse a PKIX trust engine. -
verifyDepth
PKIX verify depth.
-
-
Constructor Details
-
HTTPResourceFactoryBean
public HTTPResourceFactoryBean()Constructor.
-
-
Method Details
-
setURL
Set the URL.- Parameters:
url
- the URL
-
setBackingResource
Set the backing resource.- Parameters:
resource
- the backing resource
-
setHttpClient
public void setHttpClient(@Nullable org.apache.http.client.HttpClient client) Set theHttpClient
instance.- Parameters:
client
- client instance
-
setHttpClientContextHandler
Set a handler to manipulate theHttpClientContext
.- Parameters:
handler
- the handler to install
-
setPublicKeys
Set the resources which we will convert into certificates.- Parameters:
keys
- the resources
-
setCertificates
Set the resources which we will convert into certificates.- Parameters:
certs
- the resources
-
setUsePKIX
public void setUsePKIX(boolean flag) Set whether to use a PKIX trust engine.- Parameters:
flag
- flag to set
-
setVerifyDepth
Set the verify depth.- Parameters:
depth
- value to set
-
getCredentials
Get the configured keys and certificates lumped together as credentials.- Returns:
- the certificates null
-
getCertificates
Get the configured certificates in their native form.- Returns:
- the certificates
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<HTTPResource>
- Specified by:
getObjectType
in classAbstractFactoryBean<HTTPResource>
-
createInstance
- Specified by:
createInstance
in classAbstractFactoryBean<HTTPResource>
- Throws:
Exception
-