Class SecuritySupportImpl
- java.lang.Object
-
- com.sun.enterprise.server.pluggable.SecuritySupport
-
- com.sun.enterprise.security.ssl.impl.SecuritySupportImpl
-
@Service @Singleton public class SecuritySupportImpl extends SecuritySupport
This implements SecuritySupport used in PluggableFeatureFactory.- Author:
- Shing Wai Chan
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger_loggerstatic StringSEC_SSL_LOGGERstatic StringSHARED_LOGMESSAGE_RESOURCE-
Fields inherited from class com.sun.enterprise.server.pluggable.SecuritySupport
additionalKeyStoreProp, additionalTrustStoreProp, KEYSTORE_PASS_PROP, KEYSTORE_TYPE_PROP, keyStoreProp, TRUSTSTORE_PASS_PROP, TRUSTSTORE_TYPE_PROP, trustStoreProp
-
-
Constructor Summary
Constructors Modifier Constructor Description SecuritySupportImpl()protectedSecuritySupportImpl(boolean init)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckPermission(String key)Check permission for the given key.KeyManager[]getKeyManagers(String algorithm)KeyStoregetKeyStore(String token)KeyStore[]getKeyStores()This method returns an array of keystores containing keys and certificates.PrivateKeygetPrivateKeyForAlias(String alias, int keystoreIndex)Gets the PrivateKey for specified alias from the corresponding keystore indicated by the index.String[]getTokenNames()This method returns an array of token names in order corresponding to array of keystores.TrustManager[]getTrustManagers(String algorithm)KeyStoregetTrustStore(String token)KeyStore[]getTrustStores()This method returns an array of truststores containing certificates.booleanisACC()booleanisNotServerORACC()KeyStoreloadNullStore(String type, int index)protected static voidloadStores(String tokenName, Provider provider, String keyStoreFile, char[] keyStorePass, String keyStoreType, String trustStoreFile, char[] trustStorePass, String trustStoreType)This method will load keystore and truststore and add into corresponding list.voidreset()Resets the security instance by effectively re-initializing it.voidsynchronizeKeyFile(Object configContext, String fileRealmName)TODO:V3:Cluster ConfigContext is no longer present so find out what this needs to bebooleanverifyMasterPassword(char[] masterPass)-
Methods inherited from class com.sun.enterprise.server.pluggable.SecuritySupport
getDefaultInstance
-
-
-
-
Field Detail
-
SHARED_LOGMESSAGE_RESOURCE
public static final String SHARED_LOGMESSAGE_RESOURCE
- See Also:
- Constant Field Values
-
SEC_SSL_LOGGER
public static final String SEC_SSL_LOGGER
- See Also:
- Constant Field Values
-
_logger
protected static final Logger _logger
-
-
Method Detail
-
getKeyStores
public KeyStore[] getKeyStores()
This method returns an array of keystores containing keys and certificates.- Specified by:
getKeyStoresin classSecuritySupport
-
getTrustStores
public KeyStore[] getTrustStores()
This method returns an array of truststores containing certificates.- Specified by:
getTrustStoresin classSecuritySupport
-
getTokenNames
public String[] getTokenNames()
This method returns an array of token names in order corresponding to array of keystores.- Specified by:
getTokenNamesin classSecuritySupport
-
getKeyStore
public KeyStore getKeyStore(String token)
- Specified by:
getKeyStorein classSecuritySupport- Parameters:
token-- Returns:
- a keystore
-
getTrustStore
public KeyStore getTrustStore(String token)
- Specified by:
getTrustStorein classSecuritySupport- Parameters:
token-- Returns:
- a truststore
-
reset
public void reset()
Description copied from class:SecuritySupportResets the security instance by effectively re-initializing it.This means the default keystores and truststores will be reloaded from their default locations (which may be configured by system properties, such as with the default SecuritySupport instance).
- Overrides:
resetin classSecuritySupport
-
loadNullStore
public KeyStore loadNullStore(String type, int index) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException
- Specified by:
loadNullStorein classSecuritySupport- Returns:
- load a null keystore of given type.
- Throws:
KeyStoreExceptionIOExceptionNoSuchAlgorithmExceptionCertificateException
-
getKeyManagers
public KeyManager[] getKeyManagers(String algorithm) throws IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
- Specified by:
getKeyManagersin classSecuritySupport- Returns:
- KeyManagers for the specified algorithm.
- Throws:
IOExceptionKeyStoreExceptionNoSuchAlgorithmExceptionUnrecoverableKeyException
-
getTrustManagers
public TrustManager[] getTrustManagers(String algorithm) throws IOException, KeyStoreException, NoSuchAlgorithmException
- Specified by:
getTrustManagersin classSecuritySupport- Returns:
- TrustManagers for the specified algorithm.
- Throws:
IOExceptionKeyStoreExceptionNoSuchAlgorithmException
-
verifyMasterPassword
public boolean verifyMasterPassword(char[] masterPass)
- Specified by:
verifyMasterPasswordin classSecuritySupport- Returns:
- result whether the given master password is correct.
-
synchronizeKeyFile
public void synchronizeKeyFile(Object configContext, String fileRealmName) throws Exception
Description copied from class:SecuritySupportTODO:V3:Cluster ConfigContext is no longer present so find out what this needs to be- Specified by:
synchronizeKeyFilein classSecuritySupport- Throws:
Exception
-
getPrivateKeyForAlias
public PrivateKey getPrivateKeyForAlias(String alias, int keystoreIndex) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
Description copied from class:SecuritySupportGets the PrivateKey for specified alias from the corresponding keystore indicated by the index.- Specified by:
getPrivateKeyForAliasin classSecuritySupport- Parameters:
alias- Alias for which the PrivateKey is desired.keystoreIndex- Index of the keystore.- Returns:
- Throws:
KeyStoreExceptionNoSuchAlgorithmExceptionUnrecoverableKeyException
-
checkPermission
public void checkPermission(String key)
Description copied from class:SecuritySupportCheck permission for the given key.- Specified by:
checkPermissionin classSecuritySupport
-
isACC
public boolean isACC()
-
isNotServerORACC
public boolean isNotServerORACC()
-
loadStores
protected static void loadStores(String tokenName, Provider provider, String keyStoreFile, char[] keyStorePass, String keyStoreType, String trustStoreFile, char[] trustStorePass, String trustStoreType)
This method will load keystore and truststore and add into corresponding list.- Parameters:
tokenName-provider-keyStorePass-keyStoreFile-keyStoreType-trustStorePass-trustStoreFile-trustStoreType-
-
-