Package net.shibboleth.shared.spring.security.factory

# Class KeyStoreFactoryBean

java.lang.Object
net.shibboleth.shared.spring.security.factory.KeyStoreFactoryBean

All Implemented Interfaces:
  `FactoryBean<KeyStore>`

public class KeyStoreFactoryBean extends Object implements FactoryBean<KeyStore>
Spring bean factory for producing a `KeyStore` from a `Resource`.

Since:
  5.4.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`keyPass`
Password for the keystore.
`private KeyStore`
`keyStore`
The singleton instance of the private key produced by this factory.
`private String`
`provider`
KeyStore provider.
`private Resource`
`resource`
KeyStore resource.
`private String`
`type`
KeyStore type.

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

`OBJECT_TYPE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`KeyStoreFactoryBean()`

## Method Summary

Modifier and Type
Method
Description
`KeyStore`
`getObject()`
`Class<?>`
`getObjectType()`
`boolean`
`isSingleton()`
`void`
`setPassword(String password)`
Set the password for the keystore.
`void`
`setProvider(String prov)`
Set the KeyStore provider, if non-defaulted.
`void`
`setResource(Resource res)`
Set the resource containing the keystore.
`void`
`setType(String typ)`
Set the KeyStore type, if non-defaulted.

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

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

## Field Details

### resource

@Nullable private Resource resource
KeyStore resource.

### keyPass

@Nullable private String keyPass
Password for the keystore.

### type

@Nullable private String type
KeyStore type.

### provider

@Nullable private String provider
KeyStore provider.

### keyStore

@Nullable private KeyStore keyStore
The singleton instance of the private key produced by this factory.

## Constructor Details

### KeyStoreFactoryBean

public KeyStoreFactoryBean()

## Method Details

### setResource

public void setResource(@Nonnull Resource res)
Set the resource containing the keystore.

Parameters:
  `res` - private key resource

### setPassword

public void setPassword(@Nullable String password)
Set the password for the keystore.

Parameters:
  `password` - password for the keystore

### setProvider

public void setProvider(@Nullable String prov)
Set the KeyStore provider, if non-defaulted.

Parameters:
  `prov` - provider

### setType

public void setType(@Nullable String typ)
Set the KeyStore type, if non-defaulted.

Parameters:
  `typ` - KeyStore type

### getObject

public KeyStore getObject() throws Exception

Specified by:
  `getObject` in interface `FactoryBean<KeyStore>`
Throws:
  `Exception`

### getObjectType

@Nonnull public Class<?> getObjectType()

Specified by:
  `getObjectType` in interface `FactoryBean<KeyStore>`

### isSingleton

public boolean isSingleton()

Specified by:
  `isSingleton` in interface `FactoryBean<KeyStore>`