Class 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
    • Constructor Detail

      • SecureAdminHelperImpl

        public SecureAdminHelperImpl()
    • 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 interface 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 SecureAdminHelper
        Parameters:
        username - user-provided username
        passwordAlias - name of the password alias