Sun Adapter for LDAP API

com.stc.connector.ldapadapter.utils.cryptography.api
Interface KeyStoreUtil

All Known Implementing Classes:
KeyStoreUtilImpl

public interface KeyStoreUtil

Provides basic utility methods on the keystore such as generating secret keys, getting keys, etc.

Version:
$Revision: 1.2 $, $Date: 2008/04/23 11:03:15 $
Author:

Field Summary
static java.lang.String KEYSTORE_PASSWORD_PROPERTY_KEY
          The property key for password of the keystore.
static java.lang.String KEYSTORE_TYPE_PROPERTY_KEY
          The property key for type of the keystore.
static java.lang.String KEYSTORE_URL_PROPERTY_KEY
          The property key for URL of the keystore.
 
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.
 java.security.Key getKey(java.lang.String aAlias, char[] aPassword)
          Returns the key stored in the keystore under the specified alias and password.
 

Field Detail

KEYSTORE_URL_PROPERTY_KEY

static final java.lang.String KEYSTORE_URL_PROPERTY_KEY
The property key for URL of the keystore.

See Also:
Constant Field Values

KEYSTORE_TYPE_PROPERTY_KEY

static final java.lang.String KEYSTORE_TYPE_PROPERTY_KEY
The property key for type of the keystore.

See Also:
Constant Field Values

KEYSTORE_PASSWORD_PROPERTY_KEY

static final java.lang.String KEYSTORE_PASSWORD_PROPERTY_KEY
The property key for password of the keystore.

See Also:
Constant Field Values
Method Detail

addSymmetricKeyToKeyStore

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.

Parameters:
aKeySize - The key size.
aAlgorithm - The name of the algorithm.
aAlias - The alias name.
aPassword - The password for the key.
Throws:
java.lang.SecurityException - Thrown when failed to create the symmetric key.

getKey

java.security.Key getKey(java.lang.String aAlias,
                         char[] aPassword)
Returns the key stored in the keystore under the specified alias and password.

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.
Throws:
java.lang.SecurityException - Thrown when failed to create the symmetric key.

Sun Adapter for LDAP API