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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.apache.wss4j.common.crypto.CryptoClass<org.apache.wss4j.common.crypto.Crypto>booleanvoidsetConfiguration(Properties properties) Sets the configuration of the Crypto.voidsetCryptoProvider(Class<? extends org.apache.wss4j.common.crypto.Crypto> cryptoProviderClass) Sets theorg.apache.ws.security.components.crypto.Cryptoprovider name.voidsetDefaultX509Alias(String defaultX509Alias) Sets the alias name of the default certificate which has been specified as a property.voidsetKeyStoreLocation(org.springframework.core.io.Resource location) Sets the location of the key store to be loaded in theorg.apache.ws.security.components.crypto.Cryptoinstance.voidsetKeyStorePassword(String password) Sets the key store password.voidsetKeyStoreProvider(String provider) Sets the key store provider.voidsetKeyStoreType(String type) Sets the key store type.voidsetTrustStorePassword(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.Cryptoprovider name. Defaults toorg.apache.ws.security.components.crypto.Merlin.This property maps to the WSS4J
org.apache.ws.security.crypto.providerproperty.- Parameters:
cryptoProviderClass- the crypto provider class
-
setKeyStoreLocation
Sets the location of the key store to be loaded in theorg.apache.ws.security.components.crypto.Cryptoinstance.This property maps to the WSS4J
org.apache.ws.security.crypto.merlin.fileproperty.- 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.providerproperty.- 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.passwordproperty.- 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.typeproperty.- 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.passwordproperty.- 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.aliasproperty.- Parameters:
defaultX509Alias- alias name of the default X509 certificate
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<org.apache.wss4j.common.crypto.Crypto>- Throws:
Exception
-