For the latest news and information visit
The GNU Crypto project

gnu.crypto.auth.callback
Class Engine

java.lang.Object
  extended by gnu.crypto.auth.callback.Engine

final class Engine
extends Object

Generic implementation of the getInstance methods in the various engine classes in java.security.

These classes (Signature for example) can be thought of as the "chrome, upholstery, and steering wheel", and the SPI (service provider interface, e.g. SignatureSpi) classes can be thought of as the "engine" -- providing the actual functionality of whatever cryptographic algorithm the instance represents.

Author:
Casey Marshall
See Also:
Provider

Method Summary
(package private) static Object getInstance(String service, String algorithm, Provider provider)
          Get the implementation for algorithm for service service from provider.
(package private) static Object getInstance(String service, String algorithm, Provider provider, Object[] initArgs)
          Get the implementation for algorithm for service service from provider, passing initArgs to the SPI class's constructor (which cannot be null; pass a zero-length array if the SPI takes no arguments).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

static Object getInstance(String service,
                          String algorithm,
                          Provider provider)
                   throws InvocationTargetException,
                          NoSuchAlgorithmException
Get the implementation for algorithm for service service from provider. The service is e.g. "Signature", and the algorithm "DSA".

Parameters:
service - The service name.
algorithm - The name of the algorithm to get.
provider - The provider to get the implementation from.
Returns:
The engine class for the specified algorithm; the object returned is typically a subclass of the SPI class for that service, but callers should check that this is so.
Throws:
NoSuchAlgorithmException - If the implementation cannot be found or cannot be instantiated.
InvocationTargetException - If the SPI class's constructor throws an exception.
IllegalArgumentException - If any of the three arguments are null.

getInstance

static Object getInstance(String service,
                          String algorithm,
                          Provider provider,
                          Object[] initArgs)
                   throws InvocationTargetException,
                          NoSuchAlgorithmException
Get the implementation for algorithm for service service from provider, passing initArgs to the SPI class's constructor (which cannot be null; pass a zero-length array if the SPI takes no arguments). The service is e.g. "Signature", and the algorithm "DSA".

Parameters:
service - The service name.
algorithm - The name of the algorithm to get.
provider - The provider to get the implementation from.
initArgs - The arguments to pass to the SPI class's constructor (cannot be null).
Returns:
The engine class for the specified algorithm; the object returned is typically a subclass of the SPI class for that service, but callers should check that this is so.
Throws:
NoSuchAlgorithmException - If the implementation cannot be found or cannot be instantiated.
InvocationTargetException - If the SPI class's constructor throws an exception.
IllegalArgumentException - If any of the four arguments are null.

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.