Class CryptoFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>
,org.springframework.beans.factory.InitializingBean
Crypto
. Allows for strong-typed property configuration, or configuration
through Properties
.
Requires either individual properties, or the configuration
property
to be set.
- Since:
- 2.3.0
- Author:
- Tareq Abed Rabbo, Arjen Poutsma, Jamin Hitchcock
- See Also:
-
org.apache.ws.security.components.crypto.Crypto
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
org.apache.wss4j.common.crypto.Crypto
Class<org.apache.wss4j.common.crypto.Crypto>
boolean
void
setConfiguration
(Properties properties) Sets the configuration of the Crypto.void
setCryptoProvider
(Class<? extends org.apache.wss4j.common.crypto.Crypto> cryptoProviderClass) Sets theorg.apache.ws.security.components.crypto.Crypto
provider name.void
setDefaultX509Alias
(String defaultX509Alias) Sets the alias name of the default certificate which has been specified as a property.void
setKeyStoreLocation
(org.springframework.core.io.Resource location) Sets the location of the key store to be loaded in theorg.apache.ws.security.components.crypto.Crypto
instance.void
setKeyStorePassword
(String password) Sets the key store password.void
setKeyStoreProvider
(String provider) Sets the key store provider.void
setKeyStoreType
(String type) Sets the key store type.void
setTrustStorePassword
(String password) Sets the trust store password.
-
Constructor Details
-
CryptoFactoryBean
public CryptoFactoryBean()
-
-
Method Details
-
setConfiguration
Sets the configuration of the Crypto. Setting this property overrides all previously set configuration, through the type-safe properties- See Also:
-
org.apache.ws.security.components.crypto.CryptoFactory#getInstance(java.util.Properties)
-
setCryptoProvider
public void setCryptoProvider(Class<? extends org.apache.wss4j.common.crypto.Crypto> cryptoProviderClass) Sets theorg.apache.ws.security.components.crypto.Crypto
provider name. Defaults toorg.apache.ws.security.components.crypto.Merlin
.This property maps to the WSS4J
org.apache.ws.security.crypto.provider
property.- Parameters:
cryptoProviderClass
- the crypto provider class
-
setKeyStoreLocation
Sets the location of the key store to be loaded in theorg.apache.ws.security.components.crypto.Crypto
instance.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.file
property.- Parameters:
location
- the key store location- Throws:
IOException
- when the resource cannot be opened
-
setKeyStoreProvider
Sets the key store provider.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.keystore.provider
property.- Parameters:
provider
- the key store provider
-
setKeyStorePassword
Sets the key store password. Defaults tosecurity
.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.keystore.password
property.- Parameters:
password
- the key store password
-
setKeyStoreType
Sets the key store type. Defaults toKeyStore.getDefaultType()
.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.keystore.type
property.- Parameters:
type
- the key store type
-
setTrustStorePassword
Sets the trust store password. Defaults tochangeit
.WSS4J crypto uses the standard J2SE trust store, i.e.
$JAVA_HOME/lib/security/cacerts
.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.cacerts.password
property.- Parameters:
password
- the trust store password
-
setDefaultX509Alias
Sets the alias name of the default certificate which has been specified as a property. This should be the certificate that is used for signature and encryption. This alias corresponds to the certificate that should be used whenever KeyInfo is not present in a signed or an encrypted message.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.keystore.alias
property.- Parameters:
defaultX509Alias
- alias name of the default X509 certificate
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>
- Throws:
Exception
-