gnu.crypto.auth.callback

Class Engine

final class Engine extends Object

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

These classes (java.security.Signature for example) can be thought of as the "chrome, upholstery, and steering wheel", and the SPI (service provider interface, e.g. java.security.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
static ObjectgetInstance(String service, String algorithm, Provider provider)
Get the implementation for algorithm for service service from provider.
static ObjectgetInstance(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).

Method Detail

getInstance

static Object getInstance(String service, String algorithm, Provider provider)
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)
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.

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