com.sap.aii.security.lib

Interface KeyStoreManager


public interface KeyStoreManager

Central interface for KeyStore management.

Version:
$Id: //tc/xpi.af/710_SP_REL/src/_security_library/plib/api/com/sap/aii/security/lib/KeyStoreManager.java#2 $

Method Summary
 String[] getAllKeyStoreViews()
          Return's all the KeyStore view's.
 X509Certificate[] getCertificateChain(X509Certificate leaf, KeyStore[] aKeyStore)
          Return's all the java.security.cert.X509Certificate chain over the KeyStore array.
 com.sap.security.api.ssf.ISsfPab getISsfPab(KeyStore[] aKeyStore)
          Return's an ISsfPab for the KeyStore array.
 com.sap.security.api.ssf.ISsfProfile getISsfProfile(KeyStore keyStore, String alias, String password)
          Return's an ISsfProfile for the KeyStore and alias.
 KeyStore getKeyStore(String view)
          Return's the KeyStore for the KeyStore view.
 String[] getKeyStoreAliases(KeyStore keyStore)
          Return's all the alias's of the java.security.KeyStore.
 KeyStore[] getKeyStores(String[] aView)
          Return's the KeyStore's for the KeyStore view's.
 boolean isCertificateEntry(KeyStore keyStore, String alias)
          Returns true if the entry identified by the given alias is a trusted certificate entry, and false otherwise.
 boolean isKeyEntry(KeyStore keyStore, String alias)
          Returns true if the entry identified by the given alias is a key entry, and false otherwise.
 

Method Detail

getAllKeyStoreViews

String[] getAllKeyStoreViews()
                             throws KeyStoreException
Return's all the KeyStore view's. Attention: Only these KeyStore view's are returned for which you have code based - and user based permission.

Returns:
String[] - aKeyStoreView
Throws:
KeyStoreException

getKeyStore

KeyStore getKeyStore(String view)
                     throws KeyStoreException
Return's the KeyStore for the KeyStore view. Attention: To get the KeyStore you need code based - and user based permission.

Parameters:
view - - KeyStore view
Returns:
java.security.KeyStore
Throws:
KeyStoreException

getKeyStores

KeyStore[] getKeyStores(String[] aView)
                        throws KeyStoreException
Return's the KeyStore's for the KeyStore view's. Attention: Only these KeyStore's are returned for which you have code based - and user based permission.

Parameters:
aView - - KeyStore view's
Returns:
java.security.KeyStore[]
Throws:
KeyStoreException

getKeyStoreAliases

String[] getKeyStoreAliases(KeyStore keyStore)
                            throws KeyStoreException
Return's all the alias's of the java.security.KeyStore. Attention: Only these KeyStore's are returned for which you have code based - and user based permission.

Parameters:
keyStore - - java.security.KeyStore
Returns:
String[] - Lists all the alias names of this java.security.KeyStore
Throws:
KeyStoreException

getCertificateChain

X509Certificate[] getCertificateChain(X509Certificate leaf,
                                      KeyStore[] aKeyStore)
                                      throws KeyStoreException,
                                             CertificateException
Return's all the java.security.cert.X509Certificate chain over the KeyStore array. The resulting chain is returned with the leaf certificate at index 0. Only public certificate's of the KeyStore's are recognized. In case No certificate chain could be build upon the KeyStore array, a CertificateException is thrown. The returned certificate chain is automatically verified.

Parameters:
leaf - - java.security.cert.X509Certificate
aKeyStore - - java.security.KeyStore[] array
Returns:
X509Certificate[] - Certificate chain
Throws:
KeyStoreException
CertificateException - - The required issuer certificate cannot be found in the set of certificates

isCertificateEntry

boolean isCertificateEntry(KeyStore keyStore,
                           String alias)
                           throws KeyStoreException
Returns true if the entry identified by the given alias is a trusted certificate entry, and false otherwise. Attention: To access the KeyStore you need code based - and user based permission.

Parameters:
keyStore - - java.security.KeyStore
alias - - the alias for the keystore entry to be checked
Returns:
boolean - TRUE if given alias is a trusted certificate entry; otherwise FALSE
Throws:
KeyStoreException

isKeyEntry

boolean isKeyEntry(KeyStore keyStore,
                   String alias)
                   throws KeyStoreException
Returns true if the entry identified by the given alias is a key entry, and false otherwise. Attention: To access the KeyStore you need code based - and user based permission.

Parameters:
keyStore - - java.security.KeyStore
alias - - the alias for the keystore entry to be checked
Returns:
boolean - TRUE if alias is a key entry; otherwise FALSE
Throws:
KeyStoreException

getISsfProfile

com.sap.security.api.ssf.ISsfProfile getISsfProfile(KeyStore keyStore,
                                                    String alias,
                                                    String password)
                                                    throws KeyStoreException
Return's an ISsfProfile for the KeyStore and alias. Attention: To access the KeyStore you need code based - and user based permission.

Parameters:
keyStore - - java.security.KeyStore
alias - - Private Key
password - - Password for the Private Key entry
Returns:
ISsfProfile - Return's an ISsfProfile
Throws:
KeyStoreException

getISsfPab

com.sap.security.api.ssf.ISsfPab getISsfPab(KeyStore[] aKeyStore)
                                            throws KeyStoreException
Return's an ISsfPab for the KeyStore array. All certificate's in the KeyStore are called trusted certificate's because the keyStore owner trusts that the public key in the certificate indeed belongs to the identity identified by the subject (owner) of the certificate. Attention: To access the KeyStore you need code based - and user based permission.

Parameters:
aKeyStore - - java.security.KeyStore array
Returns:
ISsfPab - Return's an ISsfPab
Throws:
KeyStoreException


Copyright 2007 SAP AG Complete Copyright Notice