Class CryptoFactory

java.lang.Object
org.apache.ws.security.components.crypto.CryptoFactory

public abstract class CryptoFactory extends Object
CryptoFactory.

Author:
Davanum Srinivas (dims@yahoo.com).
  • Constructor Details

    • CryptoFactory

      public CryptoFactory()
  • Method Details

    • 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 cyrpto implementation was defined
    • getInstance

      public static Crypto getInstance(Properties properties)
      getInstance

      Returns an instance of Crypto. The properties are handed over the the crypto implementation. The porperties 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 implementaion and the Crypto impl class name. These properties are dependend on the crypto implementatin
      Returns:
      The cyrpto implementation or null if no cryptoClassName was defined
    • getInstance

      public static Crypto getInstance(Properties properties, ClassLoader classLoader)
      getInstance

      Returns an instance of Crypto loaded with the given classloader. The properties are handed over the the crypto implementation. The porperties 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 implementaion and the Crypto impl class name. These properties are dependend on the crypto implementatin
      classLoader - The class loader to use
      Returns:
      The cyrpto implementation or null if no cryptoClassName was defined
    • getInstance

      public static Crypto getInstance(String cryptoClassName, Properties properties)
      getInstance

      Returns an instance of Crypto. The properties are handed over the the crypto implementation. The porperties can be null. It is depenend 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 implementaion. These properties are dependend on the crypto implementatin
      Returns:
      The cyrpto implementation or null if no cryptoClassName was defined
    • getInstance

      public static Crypto getInstance(String propFilename)
      getInstance

      Returns an instance of Crypto. This method uses the specifed 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 cyrpto implementation that was defined
    • getInstance

      public static Crypto getInstance(String propFilename, ClassLoader customClassLoader)