Class SecureAdminHelperImpl
- java.lang.Object
-
- com.sun.enterprise.security.admin.cli.SecureAdminHelperImpl
-
- All Implemented Interfaces:
SecureAdminHelper
@Service @PerLookup public class SecureAdminHelperImpl extends Object implements SecureAdminHelper
Various utility methods which support secure admin operations.- Author:
- Tim Quinn
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.sun.enterprise.config.serverbeans.SecureAdminHelper
SecureAdminHelper.SecureAdminCommandException
-
-
Constructor Summary
Constructors Constructor Description SecureAdminHelperImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDN(String value, boolean isAlias)
Returns the correct DN to use for a given secure admin principal, mapping the alias (if it's an alias specified) to the DN for the corresponding cert in the key store.boolean
isAnyAdminUserWithoutPassword()
Returns whether at least one admin user has an empty password.void
validateInternalUsernameAndPasswordAlias(String username, String passwordAlias)
Makes sure the username is a valid admin username and that the password alias is defined.
-
-
-
Method Detail
-
getDN
public String getDN(String value, boolean isAlias) throws IOException, KeyStoreException
Returns the correct DN to use for a given secure admin principal, mapping the alias (if it's an alias specified) to the DN for the corresponding cert in the key store.- Specified by:
getDN
in interfaceSecureAdminHelper
- Parameters:
value
- user-provided value (alias name or the actual DN)isAlias
- whether the value is an alias- Returns:
- DN to use
- Throws:
IOException
- if there is an error accessing the key storeKeyStoreException
- if the keystore has not been initializedIllegalArgumentException
- if the cert for the specified alias as fetched from the key store is not an X509 certificate
-
validateInternalUsernameAndPasswordAlias
public void validateInternalUsernameAndPasswordAlias(String username, String passwordAlias)
Makes sure the username is a valid admin username and that the password alias is defined. This method does NOT make sure that the password associated with the username and the password associated with the password alias are the same.- Specified by:
validateInternalUsernameAndPasswordAlias
in interfaceSecureAdminHelper
- Parameters:
username
- user-provided usernamepasswordAlias
- name of the password alias
-
isAnyAdminUserWithoutPassword
public boolean isAnyAdminUserWithoutPassword() throws Exception
Returns whether at least one admin user has an empty password.- Specified by:
isAnyAdminUserWithoutPassword
in interfaceSecureAdminHelper
- Returns:
- true if at least one admin user has an empty password; false otherwise
- Throws:
BadRealmException
NoSuchRealmException
NoSuchUserException
Exception
-
-