|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavacardx.spi.security.CryptoProvider
@TransactionType(value=NOT_SUPPORTED) public abstract class CryptoProvider
This is the container for all information concerning cryptographic service implementations available from a given provider.
This class maintains the list of all cryptographic service providers. It provides static methods to retrieve cryptographic service implementations based on the name of the cryptographic algorithm and optionally the name of a provider.
When asked for a cryptographic algorithm and a specific provider, this class must lookup the provider and retrieve/determine the name of the class implementing the specified algorithm. It then returns an instance of the retrieved cryptographic algorithm.
When asked for a cryptographic algorithm without specifying a provider, this class must lookup the provider providing the required algorithm which has the higher rank in the preference order. It then returns an instance of the cryptographic algorithm class implemented by that provider.
The cryptographic algorithm name as used by this class must have one of the following formats:
The cryptographic service name for each of the cryptographic service
implementation classes is defined by the constant
SERVICE_NAME
in each of these classes. Each of these classes
also defines the constants for each of the algorithms and types these
cryptographic service support.
This class is an abstract class. It must be subclassed to provide an implementation
of the createAlgorithmImpl(String, boolean)
method that retrieves and instantiates
the class implementing the requested algorithm.
Java Card RE-owned instances of CryptoProvider are permanent Java Card runtime environment Entry Point Objects.
CryptoServices
Constructor Summary | |
---|---|
CryptoProvider(String name,
String[] algorithmNames)
Creates and registers a new provider with the specified name and the list of supported algorithms. |
Method Summary | |
---|---|
protected abstract Object |
createAlgorithmImpl(String algorithm,
boolean param)
Returns a cryptographic service implementation object corresponding to the given algorithm. |
static Object |
getAlgorithmImpl(String algorithm)
Returns a cryptographic service implementation object related to the given algorithm name. |
static Object |
getAlgorithmImpl(String algorithm,
boolean param)
Returns a cryptographic service implementation object related to the given algorithm name. |
static Object |
getAlgorithmImpl(String algorithm,
String provider)
Returns a cryptographic service implementation object related to the given algorithm and provider names. |
static Object |
getAlgorithmImpl(String algorithm,
String provider,
boolean param)
Returns a cryptographic service implementation object related to the given algorithm and provider names. |
String[] |
getAlgorithmNames()
Returns an array containing the names of all algorithms implemented by this provider. |
static String[] |
getAlgorithms()
Returns an array containing the names of all available algorithms on the platform. |
String |
getName()
Returns the name of this crypto provider. |
static String[] |
getProviders()
Returns an array containing all the installed providers. |
static String[] |
getProviders(String filter)
Returns an array containing all installed providers that satisfy the specified selection criteria, or null if no such providers have been installed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptoProvider(String name, String[] algorithmNames)
Subclasses of the CryptoProvider
class must call this constructor.
Note: Concrete implementations of this class must guarantee the immutability
of CryptoProvider
objects.
name
- the provider name.algorithmNames
- the algorithm names supported by the provider.
NullPointerException
- if name
or algorithmNames
is null.
IllegalArgumentException
- if a provider with that same name is already registered.Method Detail |
---|
public static final String[] getProviders()
Note: this method returns a different array (a defensive copy) for each call in order to guarantee the immutability of the underlying system data structure.
public static final String[] getAlgorithms()
Note: this method returns a different array (a defensive copy) upon each call in order to guarantee the immutability of the underlying system data structure.
public static final String[] getProviders(String filter)
A provider satisfies the specified selection criterion iff the provider implements the specified algorithm or type for the specified cryptographic service.
For example, "keyBuilder.DES.64" would be satisfied by any provider that
supplied a KeyBuilder
implementation for DES keys.
Note: this method returns a different array (a defensive copy) upon each call in order to guarantee the immutability of the underlying system data structure.
filter
- the criterion for selecting providers or null for any provider.
The filter is case-insensitive.
public static final Object getAlgorithmImpl(String algorithm, boolean param)
Algorithm names are in the following formats:
algorithm
- the algorithm name.param
- parameter whose interpretation is crypto service-specific; it
must correspond to:
Shareable
interface,KeyEncryption
interface.NullPointerException
- if algorithm
is null.
SecurityException
- if creating an instance of the requested cryptographic
service is not granted.public static final Object getAlgorithmImpl(String algorithm)
algorithm
- the algorithm name.
NullPointerException
- if algorithm
is null.
SecurityException
- if creating an instance of the requested cryptographic
service is not granted.public static final Object getAlgorithmImpl(String algorithm, String provider, boolean param)
algorithm
- the algorithm name.provider
- the provider name, or null for any provider.param
- parameter whose interpretation is crypto service-specific; it
must correspond to:
Shareable
interface,KeyEncryption
interface.NullPointerException
- if algorithm
is null.
SecurityException
- if creating an instance of the requested cryptographic
service is not granted.public static final Object getAlgorithmImpl(String algorithm, String provider)
algorithm
- the algorithm name.provider
- the provider name, or null for any provider.
NullPointerException
- if algorithm
is null.
SecurityException
- if creating an instance of the requested cryptographic
service is not granted.protected abstract Object createAlgorithmImpl(String algorithm, boolean param)
A provider-specific subclass must implement this method to configure the
instantiated object before being returned such as with the extra parameter
param
or with parameters extracted from the algorithm name
such as the key length for a KeyBuilder
crypto service.
algorithm
- the algorithm name.param
- parameter whose interpretation is crypto service-specific; it
must correspond to:
Shareable
interface,KeyEncryption
interface.NullPointerException
- if algorithm
is null.public String[] getAlgorithmNames()
Implementation of this method must guarantee the immutability of
CryptoProvider
objects, such as by returning a defensive
copy of the original array.
public String getName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |