org.abstracthorizon.danube.auth.jaas.keystore
Class KeyStoreModuleService

java.lang.Object
  extended by org.abstracthorizon.danube.auth.jaas.keystore.KeyStoreModuleService

public class KeyStoreModuleService
extends Object

This is keystore login module service. This class sets up keystore login module

Author:
Daniel Sendula

Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
KeyStoreModuleService()
          Default constructor
 
Method Summary
 void addUser(String user, String passwd)
          Adds new user to the store
 void changePassword(String user, String oldPassword, String newPassword)
          Changes the password of the user
 Configuration getConfiguration()
          Returns configuration
 String getControlFlag()
          Returns control flag
 String getKeyStoreProvider()
          Returns keystore provider
 String getKeyStoreType()
          Returns keystore type
 String getKeyStoreURL()
          Returns keystore url
 String getLoginContext()
          Returns login context name
 List<String> listUsers()
          Returns a list of all users in the keystore
 String listUsersString()
          Lists certificates (users) from the keystore
protected  KeyStore loadKeyStore()
           
 void removeUser(String user)
          Removes certificate - user
 void setConfiguration(Configuration configuration)
          Sets configuration
 void setControlFlag(String controlFlag)
          Sets control flag
 void setKeyStore(String keystore)
          Keystore location
 void setKeyStorePassword(String password)
          Sets keystore password
 void setKeyStoreProvider(String provider)
          Sets keystore provider
 void setKeyStoreType(String type)
          Sets keystore type
 void setLoginContext(String loginContext)
          Sets login context name
 void start()
          Starts the service - adding keystore login module to system application configuration entry
 void stop()
           
protected  void storeKeyStore(KeyStore keystore)
          Stores keystore back to provided resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger
Constructor Detail

KeyStoreModuleService

public KeyStoreModuleService()
Default constructor

Method Detail

start

public void start()
           throws Exception
Starts the service - adding keystore login module to system application configuration entry

Throws:
Exception

stop

public void stop()
          throws Exception
Throws:
Exception

listUsersString

public String listUsersString()
                       throws Exception
Lists certificates (users) from the keystore

Returns:
users as a string
Throws:
Exception

listUsers

public List<String> listUsers()
                       throws Exception
Returns a list of all users in the keystore

Returns:
list of all users in the keystore
Throws:
Exception

changePassword

public void changePassword(String user,
                           String oldPassword,
                           String newPassword)
                    throws Exception
Changes the password of the user

Parameters:
user - user
oldPassword - old password
newPassword - new password
Throws:
Exception

addUser

public void addUser(String user,
                    String passwd)
             throws Exception
Adds new user to the store

Parameters:
user - user
passwd - password
Throws:
Exception

removeUser

public void removeUser(String user)
                throws Exception
Removes certificate - user

Parameters:
user - username
Throws:
Exception

loadKeyStore

protected KeyStore loadKeyStore()
                         throws KeyStoreException,
                                NoSuchProviderException,
                                MalformedURLException,
                                IOException,
                                NoSuchAlgorithmException,
                                CertificateException
Throws:
KeyStoreException
NoSuchProviderException
MalformedURLException
IOException
NoSuchAlgorithmException
CertificateException

storeKeyStore

protected void storeKeyStore(KeyStore keystore)
                      throws KeyStoreException,
                             NoSuchProviderException,
                             MalformedURLException,
                             IOException,
                             NoSuchAlgorithmException,
                             CertificateException
Stores keystore back to provided resource

Parameters:
keystore - keystore to be stored
Throws:
KeyStoreException
NoSuchProviderException
MalformedURLException
IOException
NoSuchAlgorithmException
CertificateException

setKeyStorePassword

public void setKeyStorePassword(String password)
Sets keystore password

Parameters:
password - keystore password

setKeyStore

public void setKeyStore(String keystore)
                 throws IOException,
                        URISyntaxException
Keystore location

Parameters:
keystore - keystore location
Throws:
IOException
URISyntaxException

getKeyStoreURL

public String getKeyStoreURL()
Returns keystore url

Returns:
keystore url

setKeyStoreType

public void setKeyStoreType(String type)
Sets keystore type

Parameters:
type - keystore type

getKeyStoreType

public String getKeyStoreType()
Returns keystore type

Returns:
keystore type

setKeyStoreProvider

public void setKeyStoreProvider(String provider)
Sets keystore provider

Parameters:
provider - keystore provider

getKeyStoreProvider

public String getKeyStoreProvider()
Returns keystore provider

Returns:
keystore provider

setLoginContext

public void setLoginContext(String loginContext)
Sets login context name

Parameters:
loginContext - login context name

getLoginContext

public String getLoginContext()
Returns login context name

Returns:
login context name

setControlFlag

public void setControlFlag(String controlFlag)
Sets control flag

Parameters:
controlFlag - control flag

getControlFlag

public String getControlFlag()
Returns control flag

Returns:
control flag

getConfiguration

public Configuration getConfiguration()
Returns configuration

Returns:
configuration

setConfiguration

public void setConfiguration(Configuration configuration)
Sets configuration

Parameters:
configuration - configuration


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.