Package org.cryptacular.bean
Class ResourceBasedSecretKeyFactoryBean
java.lang.Object
org.cryptacular.bean.ResourceBasedSecretKeyFactoryBean
- All Implemented Interfaces:
FactoryBean<SecretKey>
- Author:
- Middleware Services
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.ResourceBasedSecretKeyFactoryBean
(Resource resource, String algorithm) Creates a new instance by specifying all properties. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setAlgorithm
(String algorithm) Sets the key algorithm.void
setResource
(Resource resource) Sets the resource containing key data.
-
Constructor Details
-
ResourceBasedSecretKeyFactoryBean
public ResourceBasedSecretKeyFactoryBean()Creates a new instance. -
ResourceBasedSecretKeyFactoryBean
Creates a new instance by specifying all properties.- Parameters:
resource
- Resource containing encoded key data.algorithm
- Algorithm name of cipher with which key will be used.
-
-
Method Details
-
getAlgorithm
- Returns:
- Key algorithm name, e.g. AES.
-
setAlgorithm
Sets the key algorithm.- Parameters:
algorithm
- Secret key algorithm, e.g. AES.
-
getResource
- Returns:
- Resource containing key data.
-
setResource
Sets the resource containing key data.- Parameters:
resource
- Resource containing key bytes.
-
newInstance
- Specified by:
newInstance
in interfaceFactoryBean<SecretKey>
- Returns:
- New instance of the type handled by this factory.
- Throws:
StreamException
-