Module net.shibboleth.ext.spring
Class PrivateKeyFactoryBean
- java.lang.Object
-
- net.shibboleth.ext.spring.factory.PrivateKeyFactoryBean
-
- All Implemented Interfaces:
FactoryBean<PrivateKey>
public class PrivateKeyFactoryBean extends Object implements FactoryBean<PrivateKey>
Spring bean factory for producing aPrivateKeyfrom aResource. This factory bean supports encrypted and non-encrypted PKCS8, DER, or PEM private key encoded resources.
-
-
Field Summary
Fields Modifier and Type Field Description private PrivateKeykeyThe singleton instance of the private key produced by this factory.private StringkeyPassPassword for the private key.private ResourceresourcePrivate key resource.-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description PrivateKeyFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrivateKeygetObject()Class<?>getObjectType()booleanisSingleton()voidsetPrivateKeyPassword(String password)Sets the password for the private key.voidsetResource(Resource res)Sets the resource containing the private key.
-
-
-
Field Detail
-
resource
private Resource resource
Private key resource.
-
keyPass
private String keyPass
Password for the private key.
-
key
private PrivateKey key
The singleton instance of the private key produced by this factory.
-
-
Method Detail
-
setResource
public void setResource(@Nonnull Resource res)Sets the resource containing the private key.- Parameters:
res- private key resource, nevernull
-
setPrivateKeyPassword
public void setPrivateKeyPassword(@Nullable String password)Sets the password for the private key.- Parameters:
password- password for the private key, may be null if the key is not encrypted
-
getObject
public PrivateKey getObject() throws Exception
- Specified by:
getObjectin interfaceFactoryBean<PrivateKey>- Throws:
Exception
-
getObjectType
@Nonnull public Class<?> getObjectType()
- Specified by:
getObjectTypein interfaceFactoryBean<PrivateKey>
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceFactoryBean<PrivateKey>
-
-