class CredentialManagerImpl implements CredentialManager,
		Observable<KeystoreChangedEvent> {

	@Override
	public ArrayList<String> getAliases(KeystoreType ksType) throws CMException {
		// Need to make sure we are initialized before we do anything else
		// as Credential Manager can be created but not initialized
		initialize();

		try {
			switch (ksType) {
			case KEYSTORE:
				synchronized (keystore) {
					return Collections.list(keystore.aliases());
				}
			case TRUSTSTORE:
				synchronized (truststore) {
					return Collections.list(truststore.aliases());
				}
			default:
				return null;
			}
		} catch (Exception ex) {
			String exMessage = "failed to access the " + ksType
					+ " to get the aliases";
			logger.error(exMessage, ex);
			throw new CMException(exMessage, ex);
		}
	}

	public  CredentialManagerImpl();

}