Sun Adapter for LDAP API

com.stc.connector.ldapadapter.utils.cryptography.impl
Class KeyStoreUtilImpl

java.lang.Object
  extended by com.stc.connector.ldapadapter.utils.cryptography.impl.KeyStoreUtilImpl
All Implemented Interfaces:
KeyStoreUtil

public class KeyStoreUtilImpl
extends java.lang.Object
implements KeyStoreUtil

Provides a KeyStoreUtil implementation. The getInstance(Map aProperties) factory method returnes a new instance of this implementation each time. So it does not provide a singlton and does not pool any instances.

Use the KEYSTORE_URL_PROPERTY_KEY, KEYSTORE_TYPE_PROPERTY_KEY, KEYSTORE_PASSWORD_PROPERTY_KEY keys to set the desired values in the property map when acquiring an instance.

Version:
$Revision: 1.1 $, $Date: 2004/03/04 19:37:07 $
Author:
T. Anbu Balakumaran
See Also:
KeyStoreUtil

Field Summary
 
Fields inherited from interface com.stc.connector.ldapadapter.utils.cryptography.api.KeyStoreUtil
KEYSTORE_PASSWORD_PROPERTY_KEY, KEYSTORE_TYPE_PROPERTY_KEY, KEYSTORE_URL_PROPERTY_KEY
 
Method Summary
 void addSymmetricKeyToKeyStore(int aKeySize, java.lang.String aAlgorithm, java.lang.String aAlias, char[] aPassword)
          Geneartes a symmetric key(secret key) and stores it in the keystore.
static KeyStoreUtil getInstance(java.util.Map aProperties)
          Returns a new instance of a KeyStoreUtil based on the specified properties.
 java.security.Key getKey(java.lang.String aAlias, char[] aPassword)
          Returns the key stored in the keystore under the specified alias and password.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static KeyStoreUtil getInstance(java.util.Map aProperties)
Returns a new instance of a KeyStoreUtil based on the specified properties.

Use the KEYSTORE_URL_PROPERTY_KEY, KEYSTORE_TYPE_PROPERTY_KEY, KEYSTORE_PASSWORD_PROPERTY_KEY keys to set the desired values in the property map when acquiring an instance.

Parameters:
aProperties - The map view of the properties to use in getting the instance.
Returns:
A new instance of a KeyStoreUtil based on the specified properties.
Throws:
java.lang.SecurityException - Thrown when failed to create a new instance.

addSymmetricKeyToKeyStore

public void addSymmetricKeyToKeyStore(int aKeySize,
                                      java.lang.String aAlgorithm,
                                      java.lang.String aAlias,
                                      char[] aPassword)
Description copied from interface: KeyStoreUtil
Geneartes a symmetric key(secret key) and stores it in the keystore.

Specified by:
addSymmetricKeyToKeyStore in interface KeyStoreUtil
Parameters:
aKeySize - The key size.
aAlgorithm - The name of the algorithm.
aAlias - The alias name.
aPassword - The password for the key.
See Also:
KeyStoreUtil#genSymmetricKey

getKey

public java.security.Key getKey(java.lang.String aAlias,
                                char[] aPassword)
Description copied from interface: KeyStoreUtil
Returns the key stored in the keystore under the specified alias and password.

Specified by:
getKey in interface KeyStoreUtil
Parameters:
aAlias - The alias name.
aPassword - The password for the key.
Returns:
Returns the key stored in the key store under the specified alias and password.
See Also:
KeyStoreUtil.getKey(java.lang.String, char[])

main

public static void main(java.lang.String[] args)

Sun Adapter for LDAP API