Package org.cryptacular.bean
Class KeyStoreFactoryBean
java.lang.Object
org.cryptacular.bean.KeyStoreFactoryBean
- All Implemented Interfaces:
FactoryBean<KeyStore>
Factory bean that produces a
KeyStore from a file or URI.- Author:
- Middleware Services
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.KeyStoreFactoryBean(Resource resource, String type, String password) Creates a new instance by specifying all properties. -
Method Summary
Modifier and TypeMethodDescriptiongetType()voidsetPassword(String password) Sets the keystore password required to decrypt an encrypted keystore.voidsetResource(Resource resource) Sets the resource that provides encoded keystore data.voidSets the keystore type.
-
Field Details
-
DEFAULT_TYPE
Default keystore type, "JCEKS".- See Also:
-
-
Constructor Details
-
KeyStoreFactoryBean
public KeyStoreFactoryBean()Creates a new instance. -
KeyStoreFactoryBean
Creates a new instance by specifying all properties.- Parameters:
resource- Resource containing encoded keystore data.type- Keystore type, e.g. JCEKS.password- Password used to decrypt key entry in keystore.
-
-
Method Details
-
getType
- Returns:
- Keystore type.
-
setType
Sets the keystore type.- Parameters:
type- JCEKS (default), JKS, PKCS12, or BKS. NOTE: BKS type is supported only when BC provider is installed.
-
getResource
- Returns:
- Resource that provides encoded keystore data.
-
setResource
Sets the resource that provides encoded keystore data.- Parameters:
resource- Keystore resource.
-
setPassword
Sets the keystore password required to decrypt an encrypted keystore.- Parameters:
password- Keystore password.
-
newInstance
- Specified by:
newInstancein interfaceFactoryBean<KeyStore>- Returns:
- New instance of the type handled by this factory.
-