public class ResourceBasedSecretKeyFactoryBean extends java.lang.Object implements FactoryBean<javax.crypto.SecretKey>
SecretKey from a Resource.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
algorithm
Key algorithm.
|
private Resource |
resource
Resource containing key data.
|
| Constructor and Description |
|---|
ResourceBasedSecretKeyFactoryBean()
Creates a new instance.
|
ResourceBasedSecretKeyFactoryBean(Resource resource,
java.lang.String algorithm)
Creates a new instance by specifying all properties.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlgorithm() |
Resource |
getResource() |
javax.crypto.SecretKey |
newInstance() |
void |
setAlgorithm(java.lang.String algorithm)
Sets the key algorithm.
|
void |
setResource(Resource resource)
Sets the resource containing key data.
|
private java.lang.String algorithm
private Resource resource
public ResourceBasedSecretKeyFactoryBean()
public ResourceBasedSecretKeyFactoryBean(Resource resource, java.lang.String algorithm)
resource - Resource containing encoded key data.algorithm - Algorithm name of cipher with which key will be used.public java.lang.String getAlgorithm()
public void setAlgorithm(java.lang.String algorithm)
algorithm - Secret key algorithm, e.g. AES.public Resource getResource()
public void setResource(Resource resource)
resource - Resource containing key bytes.public javax.crypto.SecretKey newInstance()
throws StreamException
newInstance in interface FactoryBean<javax.crypto.SecretKey>StreamException