Package org.opensaml.spring.credential

# Class BasicX509CredentialFactoryBean

java.lang.Object
net.shibboleth.shared.spring.factory.AbstractFactoryBean<T>
net.shibboleth.shared.spring.factory.AbstractComponentAwareFactoryBean<T>
org.opensaml.spring.credential.AbstractCredentialFactoryBean<BasicX509Credential>
org.opensaml.spring.credential.AbstractX509CredentialFactoryBean
org.opensaml.spring.credential.BasicX509CredentialFactoryBean

All Implemented Interfaces:
  `Aware`, `BeanClassLoaderAware`, `BeanFactoryAware`, `DisposableBean`, `FactoryBean<BasicX509Credential>`, `InitializingBean`

public class BasicX509CredentialFactoryBean extends AbstractX509CredentialFactoryBean
Spring bean factory for producing a `BasicX509Credential` from `Resource`s.

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>`
`certificateResources`
Where the certificates are to be found.
`private List<Resource>`
`crlResources`
Where the crls are to be found.
`private Resource`
`entityResource`
The specification of where the entity Resource is to be found.
`private final org.slf4j.Logger`
`log`
log.
`private Resource`
`privateKeyResource`
Where the private key is to be found.

### Fields inherited from interface org.springframework.beans.factory.FactoryBean

`OBJECT_TYPE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`BasicX509CredentialFactoryBean()`

## Method Summary

Modifier and Type
Method
Description
`protected List<X509Certificate>`
`getCertificates()`
Get the configured certificates.
`protected List<X509CRL>`
`getCRLs()`
Get the configured CRL list.
`protected X509Certificate`
`getEntityCertificate()`
return the explicitly configured entity certificate.
`protected PrivateKey`
`getPrivateKey()`
Get the configured private key.
`boolean`
`isSingleton()`
`void`
`setCertificateResource(Resource res)`
Set the certificate resource.
`void`
`setCertificates(List<Resource> what)`
Sets the Resources which contain the certificates.
`void`
`setCRLs(List<Resource> what)`
Sets the Resources which contain the crls.
`void`
`setEntity(Resource what)`
Set the Resource with the entity certificate.
`void`
`setEntityId(String id)`
Set the entityID for the credential.
`void`
`setPrivateKey(Resource what)`
Set the Resource with the entity certificate.
`void`
`setPrivateKeyPassword(String password)`
Set the password for the private key.
`void`
`setPrivateKeyResource(Resource res)`
Set the resource containing the private key.

### Methods inherited from class org.opensaml.spring.credential.AbstractX509CredentialFactoryBean

`doCreateInstance, getObjectType`

### Methods inherited from class org.opensaml.spring.credential.AbstractCredentialFactoryBean

`getConfigDescription, getEntityID, getKeyNames, getPrivateKeyPassword, getUsageType, setConfigDescription, setEntityID, setKeyNames, setPrivateKeyPassword, setUsageType`

### Methods inherited from class net.shibboleth.shared.spring.factory.AbstractComponentAwareFactoryBean

`createInstance, destroyInstance, setThrowIfNull`

### Methods inherited from class net.shibboleth.shared.spring.factory.AbstractFactoryBean

`afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, setBeanClassLoader, setBeanFactory, setSingleton`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
log.

### entityResource

@Nullable private Resource entityResource
The specification of where the entity Resource is to be found.

### certificateResources

@Nullable private List<Resource> certificateResources
Where the certificates are to be found.

### privateKeyResource

@Nullable private Resource privateKeyResource
Where the private key is to be found.

### crlResources

@Nullable private List<Resource> crlResources
Where the crls are to be found.

## Constructor Details

### BasicX509CredentialFactoryBean

public BasicX509CredentialFactoryBean()

## Method Details

### 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, never `null`

### 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:
  `isSingleton` in interface `FactoryBean<BasicX509Credential>`
Overrides:
  `isSingleton` in class `AbstractFactoryBean<BasicX509Credential>`

### getEntityCertificate

@Nullable protected X509Certificate getEntityCertificate()
return the explicitly configured entity certificate..

Specified by:
  `getEntityCertificate` in class `AbstractX509CredentialFactoryBean`
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:
  `getCertificates` in class `AbstractX509CredentialFactoryBean`
Returns:
  the certificates.

### getPrivateKey

@Nullable protected PrivateKey getPrivateKey()
Get the configured private key.

Specified by:
  `getPrivateKey` in class `AbstractX509CredentialFactoryBean`
Returns:
  the key or null if non configured

### getCRLs

@Nullable protected List<X509CRL> getCRLs()
Get the configured CRL list.

Specified by:
  `getCRLs` in class `AbstractX509CredentialFactoryBean`
Returns:
  the crls or null