org.kuali.rice.ksb.security.admin.service.impl
Class JavaSecurityManagementServiceImpl

java.lang.Object
  extended by org.kuali.rice.ksb.security.admin.service.impl.JavaSecurityManagementServiceImpl
All Implemented Interfaces:
JavaSecurityManagementService, org.springframework.beans.factory.InitializingBean

public class JavaSecurityManagementServiceImpl
extends Object
implements JavaSecurityManagementService, org.springframework.beans.factory.InitializingBean

This is an implementation of the JavaSecurityManagementService interface used by the KSB module

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected  String CLIENT_KEY_GENERATOR_ALGORITHM
           
protected  int CLIENT_KEY_PAIR_KEY_SIZE
           
protected  String CLIENT_SECURE_RANDOM_ALGORITHM
           
 
Constructor Summary
JavaSecurityManagementServiceImpl()
           
 
Method Summary
protected  void addClientCertificateToModuleKeyStore(String alias, Certificate clientCertificate)
           
 void afterPropertiesSet()
          Load the module's keystore and private key for this "application"
protected  Certificate generateCertificate(KeyPair keyPair, String alias)
           
 KeyStore generateClientKeystore(String alias, String clientPassphrase)
           
protected  KeyStore generateKeyStore(Certificate cert, PrivateKey privateKey, String alias, String keyStorePassword)
           
 Certificate getCertificate(String alias)
           
 String getCertificateAlias(Certificate certificate)
           
 List<KeyStoreEntryDataContainer> getListOfModuleKeyStoreEntries()
           
protected  String getModuleAlgorithm()
           
 KeyStore getModuleKeyStore()
           
 String getModuleKeyStoreAlias()
           
 String getModuleKeyStoreLocation()
           
 String getModuleKeyStorePassword()
           
protected  String getModuleKeyStoreType()
           
 PrivateKey getModulePrivateKey()
           
 String getModuleSignatureAlgorithm()
           
 boolean isAliasInKeystore(String alias)
           
protected  KeyStore loadKeyStore()
           
protected  PrivateKey loadPrivateKey()
           
 void removeClientCertificate(String alias)
           
 void setModuleKeyStoreAlias(String moduleKeyStoreAlias)
           
 void setModuleKeyStoreLocation(String moduleKeyStoreLocation)
           
 void setModuleKeyStorePassword(String moduleKeyStorePassword)
           
protected  void verifyConfiguration()
          Verifies the configuration of this service and throws an exception if it is not configured properly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_KEY_GENERATOR_ALGORITHM

protected final String CLIENT_KEY_GENERATOR_ALGORITHM
See Also:
Constant Field Values

CLIENT_SECURE_RANDOM_ALGORITHM

protected final String CLIENT_SECURE_RANDOM_ALGORITHM
See Also:
Constant Field Values

CLIENT_KEY_PAIR_KEY_SIZE

protected final int CLIENT_KEY_PAIR_KEY_SIZE
See Also:
Constant Field Values
Constructor Detail

JavaSecurityManagementServiceImpl

public JavaSecurityManagementServiceImpl()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Load the module's keystore and private key for this "application"

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

verifyConfiguration

protected void verifyConfiguration()
Verifies the configuration of this service and throws an exception if it is not configured properly.


loadKeyStore

protected KeyStore loadKeyStore()
                         throws GeneralSecurityException,
                                IOException
Throws:
GeneralSecurityException
IOException

loadPrivateKey

protected PrivateKey loadPrivateKey()
                             throws GeneralSecurityException
Throws:
GeneralSecurityException

removeClientCertificate

public void removeClientCertificate(String alias)
                             throws KeyStoreException
Specified by:
removeClientCertificate in interface JavaSecurityManagementService
Throws:
KeyStoreException

addClientCertificateToModuleKeyStore

protected void addClientCertificateToModuleKeyStore(String alias,
                                                    Certificate clientCertificate)
                                             throws KeyStoreException
Throws:
KeyStoreException

isAliasInKeystore

public boolean isAliasInKeystore(String alias)
                          throws KeyStoreException
Specified by:
isAliasInKeystore in interface JavaSecurityManagementService
Throws:
KeyStoreException

getCertificateAlias

public String getCertificateAlias(Certificate certificate)
                           throws KeyStoreException
Specified by:
getCertificateAlias in interface JavaSecurityManagementService
Throws:
KeyStoreException

generateClientKeystore

public KeyStore generateClientKeystore(String alias,
                                       String clientPassphrase)
                                throws GeneralSecurityException
Specified by:
generateClientKeystore in interface JavaSecurityManagementService
Throws:
GeneralSecurityException

generateCertificate

protected Certificate generateCertificate(KeyPair keyPair,
                                          String alias)
                                   throws GeneralSecurityException
Throws:
GeneralSecurityException

generateKeyStore

protected KeyStore generateKeyStore(Certificate cert,
                                    PrivateKey privateKey,
                                    String alias,
                                    String keyStorePassword)
                             throws GeneralSecurityException,
                                    IOException
Throws:
GeneralSecurityException
IOException

getListOfModuleKeyStoreEntries

public List<KeyStoreEntryDataContainer> getListOfModuleKeyStoreEntries()
Specified by:
getListOfModuleKeyStoreEntries in interface JavaSecurityManagementService

getModuleSignatureAlgorithm

public String getModuleSignatureAlgorithm()
Specified by:
getModuleSignatureAlgorithm in interface JavaSecurityManagementService

getCertificate

public Certificate getCertificate(String alias)
                           throws KeyStoreException
Specified by:
getCertificate in interface JavaSecurityManagementService
Throws:
KeyStoreException
See Also:
KeyStore.getCertificate(java.lang.String)

getModuleKeyStoreType

protected String getModuleKeyStoreType()

getModuleAlgorithm

protected String getModuleAlgorithm()

getModuleKeyStoreLocation

public String getModuleKeyStoreLocation()
Specified by:
getModuleKeyStoreLocation in interface JavaSecurityManagementService

setModuleKeyStoreLocation

public void setModuleKeyStoreLocation(String moduleKeyStoreLocation)

getModuleKeyStoreAlias

public String getModuleKeyStoreAlias()
Specified by:
getModuleKeyStoreAlias in interface JavaSecurityManagementService

setModuleKeyStoreAlias

public void setModuleKeyStoreAlias(String moduleKeyStoreAlias)

getModuleKeyStorePassword

public String getModuleKeyStorePassword()

setModuleKeyStorePassword

public void setModuleKeyStorePassword(String moduleKeyStorePassword)

getModuleKeyStore

public KeyStore getModuleKeyStore()

getModulePrivateKey

public PrivateKey getModulePrivateKey()
Specified by:
getModulePrivateKey in interface JavaSecurityManagementService


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.