hcrypto.provider
Class Provider

java.lang.Object
  |
  +--hcrypto.provider.Provider
Direct Known Subclasses:
DefaultProvider, RamProvider

public class Provider
extends java.lang.Object


Field Summary
static java.lang.String DELIMITER
          The delimiter used to return a list of algorithm names.
protected  java.util.Hashtable keyTable
           
protected  java.lang.String name
          Stores the name of the provider.
protected  java.util.Hashtable spiTable
           
 
Constructor Summary
Provider()
          default constructor.
Provider(java.lang.String s)
           
 
Method Summary
static void addCipher(java.lang.String cipher, java.lang.String provider, java.lang.String spiName)
           
static void addCipher(java.lang.String cipher, java.lang.String provider, java.lang.String spiName, java.lang.String keyName)
           
static void addProvider(Provider p)
          Adds the designated provider to the list of available providers.
 java.lang.String getCipherEngine(java.lang.String algorithm)
          Searches the main provider's internal lists for an instance of a provider that implements the desired algorithm.
 java.lang.String getCipherEngine(java.lang.String algorithm, java.lang.String provider)
          Searches the main provider's internal lists for an instance of the provider named in the second parameter that implements the desired algorithm.
 java.lang.String getCipherKeyName(java.lang.String algorithm)
          Searches the main provider's internal lists for an instance of a provider that implements the desired key.
 java.lang.String getCipherKeyName(java.lang.String algorithm, java.lang.String provider)
          Searches the main provider's internal lists for an instance of the provider named in the second parameter that implements the desired algorithm.
static java.lang.String getCipherNames()
          Returns a comma-delimited string of the names of the cipher algorithms.
 java.lang.String getName()
          Returns the name of this provider object.
 void put(java.lang.String cipherName, java.lang.String engineClass, java.lang.String keyClass)
          Inserts the names of the engineClass and keyClass into the appropriate tables thereby associating them with the named cipher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER

public static final java.lang.String DELIMITER
The delimiter used to return a list of algorithm names.

name

protected java.lang.String name
Stores the name of the provider.

spiTable

protected java.util.Hashtable spiTable

keyTable

protected java.util.Hashtable keyTable
Constructor Detail

Provider

public Provider()
default constructor.

Provider

public Provider(java.lang.String s)
Method Detail

getName

public java.lang.String getName()
Returns the name of this provider object.

put

public void put(java.lang.String cipherName,
                java.lang.String engineClass,
                java.lang.String keyClass)
Inserts the names of the engineClass and keyClass into the appropriate tables thereby associating them with the named cipher.
Parameters:
cipherName - a String giving the name of the cipher.
engineClass - a String giving the name of the associated engine.
keyClass - a String giving the name of the associated key.

getCipherEngine

public java.lang.String getCipherEngine(java.lang.String algorithm)
                                 throws java.lang.Exception
Searches the main provider's internal lists for an instance of a provider that implements the desired algorithm.
Parameters:
algorithm - a String giving the name of the desired algorithm.

getCipherKeyName

public java.lang.String getCipherKeyName(java.lang.String algorithm)
                                  throws java.lang.Exception
Searches the main provider's internal lists for an instance of a provider that implements the desired key.
Parameters:
algorithm - a String giving the name of the desired algorithm.

getCipherEngine

public java.lang.String getCipherEngine(java.lang.String algorithm,
                                        java.lang.String provider)
                                 throws java.lang.Exception
Searches the main provider's internal lists for an instance of the provider named in the second parameter that implements the desired algorithm.
Parameters:
algorithm - a String giving the name of the desired algorithm.
provider - a String giving the name of the desired provider.

getCipherKeyName

public java.lang.String getCipherKeyName(java.lang.String algorithm,
                                         java.lang.String provider)
                                  throws java.lang.Exception
Searches the main provider's internal lists for an instance of the provider named in the second parameter that implements the desired algorithm.
Parameters:
algorithm - a String giving the name of the desired algorithm.
provider - a String giving the name of the desired provider.

addProvider

public static void addProvider(Provider p)
Adds the designated provider to the list of available providers.
Parameters:
p - a reference to the provider object.

addCipher

public static void addCipher(java.lang.String cipher,
                             java.lang.String provider,
                             java.lang.String spiName)

addCipher

public static void addCipher(java.lang.String cipher,
                             java.lang.String provider,
                             java.lang.String spiName,
                             java.lang.String keyName)

getCipherNames

public static java.lang.String getCipherNames()
Returns a comma-delimited string of the names of the cipher algorithms. The names are returned in the format "Algorithm(Provider)". For example "Caesar(Default)"
Parameters:
p - a reference to the provider object.