public abstract class CryptoFactory extends Object
Constructor and Description |
---|
CryptoFactory() |
Modifier and Type | Method and Description |
---|---|
static Crypto |
getInstance()
getInstance
Returns an instance of Crypto.
|
static Crypto |
getInstance(Class<? extends Crypto> cryptoClass,
Map<Object,Object> map)
getInstance
Returns an instance of Crypto.
|
static Crypto |
getInstance(Properties properties)
getInstance
Returns an instance of Crypto.
|
static Crypto |
getInstance(Properties properties,
ClassLoader classLoader,
PasswordEncryptor passwordEncryptor)
getInstance
Returns an instance of Crypto loaded with the given classloader.
|
static Crypto |
getInstance(String propFilename)
getInstance
Returns an instance of Crypto.
|
static Crypto |
getInstance(String propFilename,
ClassLoader customClassLoader) |
static Properties |
getProperties(String propFilename,
ClassLoader loader)
This allows loading the resources with a custom class loader
|
public static Crypto getInstance() throws WSSecurityException
crypto.properties
to determine which implementation to
use. Thus the property org.apache.wss4j.crypto.provider
must define the classname of the Crypto implementation. The file
may contain other property definitions as well. These properties are
handed over to the Crypto implementation. The file
crypto.properties
is loaded with the
Loader.getResource()
method.
WSSecurityException
- if there is an error in loading the crypto propertiespublic static Crypto getInstance(Properties properties) throws WSSecurityException
properties
- The Properties that are forwarded to the crypto implementation
and the Crypto impl class name.
These properties are dependent on the crypto implementationWSSecurityException
- if there is an error in loading the crypto propertiespublic static Crypto getInstance(Properties properties, ClassLoader classLoader, PasswordEncryptor passwordEncryptor) throws WSSecurityException
properties
- The Properties that are forwarded to the crypto implementation
and the Crypto impl class name.
These properties are dependent on the crypto implementationclassLoader
- The class loader to usepasswordEncryptor
- The PasswordEncryptor to use to decrypt encrypted passwordsWSSecurityException
- if there is an error in loading the crypto propertiespublic static Crypto getInstance(Class<? extends Crypto> cryptoClass, Map<Object,Object> map) throws WSSecurityException
null
. It is dependent on the
Crypto implementation how the initialization is done in this case.
cryptoClass
- This is the crypto implementation class. No default is
provided here.map
- The Maps that is forwarded to the crypto implementation.
These contents of the map are dependent on the
underlying crypto implementation specified in the
cryptoClassName parameter.WSSecurityException
- if there is an error in loading the crypto propertiespublic static Crypto getInstance(String propFilename) throws WSSecurityException
org.apache.wss4j.crypto.provider
to define the classname of the Crypto implementation. The file
may contain other property definitions as well. These properties are
handed over to the Crypto implementation. The specified file
is loaded with the Loader.getResource()
method.
propFilename
- The name of the property file to loadWSSecurityException
- if there is an error in loading the crypto propertiespublic static Crypto getInstance(String propFilename, ClassLoader customClassLoader) throws WSSecurityException
WSSecurityException
public static Properties getProperties(String propFilename, ClassLoader loader) throws WSSecurityException
propFilename
- loader
- WSSecurityException
- if there is an error in loading the crypto propertiesCopyright © 2017 JBoss by Red Hat. All rights reserved.