public class ResourceBasedPrivateKeyFactoryBean extends java.lang.Object implements FactoryBean<java.security.PrivateKey>
Resource containing data in any of the formats supported by KeyPairUtil.readPrivateKey(java.io.InputStream, char[]).| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
password
Password required to decrypt an encrypted private key.
|
private Resource |
resource
Resource containing key data.
|
| Constructor and Description |
|---|
ResourceBasedPrivateKeyFactoryBean()
Creates a new instance.
|
ResourceBasedPrivateKeyFactoryBean(Resource resource)
Creates a new instance capable of reading an unencrypted private key.
|
ResourceBasedPrivateKeyFactoryBean(Resource resource,
java.lang.String decryptionPassword)
Creates a new instance of reading an encrypted private key.
|
| Modifier and Type | Method and Description |
|---|---|
Resource |
getResource() |
java.security.PrivateKey |
newInstance() |
void |
setPassword(java.lang.String decryptionPassword)
Sets the password-based key used to decrypt an encrypted private key.
|
void |
setResource(Resource resource)
Sets the resource containing key data.
|
private Resource resource
private java.lang.String password
public ResourceBasedPrivateKeyFactoryBean()
public ResourceBasedPrivateKeyFactoryBean(Resource resource)
resource - Resource containing encoded key data.public ResourceBasedPrivateKeyFactoryBean(Resource resource, java.lang.String decryptionPassword)
resource - Resource containing encoded key data.decryptionPassword - Password-based encryption key.public Resource getResource()
public void setResource(Resource resource)
resource - Resource containing key bytes.public void setPassword(java.lang.String decryptionPassword)
decryptionPassword - Password-based encryption key.public java.security.PrivateKey newInstance()
throws EncodingException,
StreamException
newInstance in interface FactoryBean<java.security.PrivateKey>EncodingExceptionStreamException