org.apache.ws.security.components.crypto
Class CryptoFactory

java.lang.Object
  extended byorg.apache.ws.security.components.crypto.CryptoFactory

public abstract class CryptoFactory
extends java.lang.Object

CryptoFactory.

Author:
Davanum Srinivas (dims@yahoo.com).

Constructor Summary
CryptoFactory()
           
 
Method Summary
static Crypto getInstance()
          getInstance

Returns an instance of Crypto.

static Crypto getInstance(java.util.Properties properties)
          getInstance

Returns an instance of Crypto.

static Crypto getInstance(java.util.Properties properties, java.lang.ClassLoader classLoader)
          getInstance

Returns an instance of Crypto loaded with the given classloader.

static Crypto getInstance(java.lang.String propFilename)
          getInstance

Returns an instance of Crypto.

static Crypto getInstance(java.lang.String propFilename, java.lang.ClassLoader customClassLoader)
           
static Crypto getInstance(java.lang.String cryptoClassName, java.util.Map map)
          getInstance

Returns an instance of Crypto.

static Crypto getInstance(java.lang.String cryptoClassName, java.util.Properties properties)
          Deprecated. use @link{#getInstance(java.lang.String, java.util.Map)} instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CryptoFactory

public CryptoFactory()
Method Detail

getInstance

public static Crypto getInstance()
getInstance

Returns an instance of Crypto. This method uses the file crypto.properties to determine which implementation to use. Thus the property org.apache.ws.security.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.

Returns:
The crypto implementation was defined

getInstance

public static Crypto getInstance(java.util.Properties properties)
getInstance

Returns an instance of Crypto. The properties are handed over the the crypto implementation. The properties must at least contain the Crypto implementation class name as the value of the property : org.apache.ws.security.crypto.provider

Parameters:
properties - The Properties that are forwarded to the crypto implementation and the Crypto impl class name. These properties are dependent on the crypto implementation
Returns:
The cyrpto implementation or null if no cryptoClassName was defined

getInstance

public static Crypto getInstance(java.util.Properties properties,
                                 java.lang.ClassLoader classLoader)
getInstance

Returns an instance of Crypto loaded with the given classloader. The properties are handed over the the crypto implementation. The properties must at least contain the Crypto implementation class name as the value of the property : org.apache.ws.security.crypto.provider

Parameters:
properties - The Properties that are forwarded to the crypto implementation and the Crypto impl class name. These properties are dependent on the crypto implementation
classLoader - The class loader to use
Returns:
The crypto implementation or null if no cryptoClassName was defined

getInstance

public static Crypto getInstance(java.lang.String cryptoClassName,
                                 java.util.Properties properties)
Deprecated. use @link{#getInstance(java.lang.String, java.util.Map)} instead.

getInstance

Returns an instance of Crypto. The properties are handed over the the crypto implementation. The properties can be null. It is dependent on the Crypto implementation how the initialization is done in this case.

Parameters:
cryptoClassName - This is the crypto implementation class. No default is provided here.
properties - The Properties that are forwarded to the crypto implementation. These properties are dependent on the crypto implementation
Returns:
The crypto implementation or null if no cryptoClassName was defined

getInstance

public static Crypto getInstance(java.lang.String cryptoClassName,
                                 java.util.Map map)
getInstance

Returns an instance of Crypto. The supplied map is handed over the the crypto implementation. The map can be null. It is dependent on the Crypto implementation how the initialization is done in this case.

Parameters:
cryptoClassName - 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.
Returns:
The crypto implementation or null if no cryptoClassName was defined

getInstance

public static Crypto getInstance(java.lang.String propFilename)
getInstance

Returns an instance of Crypto. This method uses the specified filename to load a property file. This file shall use the property org.apache.ws.security.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.

Parameters:
propFilename - The name of the property file to load
Returns:
The crypto implementation that was defined

getInstance

public static Crypto getInstance(java.lang.String propFilename,
                                 java.lang.ClassLoader customClassLoader)


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.