Class SecureAdminHelperImpl

java.lang.Object
com.sun.enterprise.security.admin.cli.SecureAdminHelperImpl
All Implemented Interfaces:
com.sun.enterprise.config.serverbeans.SecureAdminHelper

@Service @PerLookup public class SecureAdminHelperImpl extends Object implements com.sun.enterprise.config.serverbeans.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

    com.sun.enterprise.config.serverbeans.SecureAdminHelper.SecureAdminCommandException
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    Returns whether at least one admin user has an empty password.
    void
    Makes sure the username is a valid admin username and that the password alias is defined.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SecureAdminHelperImpl

      public SecureAdminHelperImpl()
  • Method Details

    • 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 interface com.sun.enterprise.config.serverbeans.SecureAdminHelper
      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 store
      KeyStoreException - if the keystore has not been initialized
      IllegalArgumentException - 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 interface com.sun.enterprise.config.serverbeans.SecureAdminHelper
      Parameters:
      username - user-provided username
      passwordAlias - 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 interface com.sun.enterprise.config.serverbeans.SecureAdminHelper
      Returns:
      true if at least one admin user has an empty password; false otherwise
      Throws:
      BadRealmException
      NoSuchRealmException
      NoSuchUserException
      Exception