CryptoServices (Java Card API, Connected Edition)
Date: 2009-12-11

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javacardx.security
Class CryptoServices

    java.lang.Object
      javacardx.security.CryptoServices

    @TransactionType(value=NOT_SUPPORTED)
    public final class CryptoServices

extends Object

This class centralizes information about all cryptographic algorithm and the cryptographic service providers supported on the platform.

A cryptographic service is always associated with a particular algorithm or type. For example, a digital signature service is always associated with a particular algorithm (e.g., DSA). Cryptographic services are implemented by the following classes:

- `javacard.security.CheckSum`.
- `javacard.security.KeyAgreement`.
- `javacard.security.KeyBuilder`.
- `javacard.security.KeyPair`.
- `javacard.security.MessageDigest`.
- `javacard.security.RandomData`.
- `javacard.security.Signature`.
- `javacardx.crypto.Cipher`.

The cryptographic algorithm name as used by this class must have one of the following formats:

- <crypto_service>.<algorithm_or_type>
- <crypto_service>.<key_algorithm_or_type>.<key_length>

The cryptographic service name for each of the cryptographic service implementation classes listed above 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.

Since:
  Java Card 3.0
See Also:
  `Checksum`, `KeyAgreement`, `KeyBuilder`, `KeyPair`, `MessageDigest`, `RandomData`, `Signature`, `Cipher`

Method Summary
`static String[]` | `getAlgorithms()` Returns an array containing the names of all available algorithms on the platform.
`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`

Method Detail

### getProviders

    public static String[] getProviders()

  Returns an array containing all the installed providers. The order of the providers in the array is their preference order.

  Note: this method returns a different array (a defensive copy) upon each call in order to guarantee the immutability of the underlying system data structures.

  Returns:
    an array of all the installed providers, or null if none have been installed.

### getAlgorithms

    public static String[] getAlgorithms()

  Returns an array containing the names of all available algorithms on the platform. Algorithm names are in the form:
  - <crypto_service>.<algorithm_or_type>
  - <crypto_service>.<key_algorithm_or_type>.<key_length>
  For example, "keyBuilder.DES".

  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.

  Returns:
    an array containing the names of all available algorithms on the platform, or null if none have been installed.

### getProviders

    public 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. The returned providers are ordered according to their preference order. The selection criterion must be specified in the following format:
  - <crypto_service>.<algorithm_or_type>
  - <crypto_service>.<key_algorithm_or_type>.<key_length>

  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" 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.

  Parameters:
    `filter` - the criterion for selecting providers or null for any provider. The filter is case-insensitive.
  Returns:
    all the installed providers that satisfy the selection criterion, or null if no such providers have been installed.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.