@Service @PerLookup public class SecureAdminHelperImpl extends Object implements SecureAdminHelper
SecureAdminHelper.SecureAdminCommandException| Constructor and Description |
|---|
SecureAdminHelperImpl() |
| Modifier and Type | Method and 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.
|
public String getDN(String value, boolean isAlias) throws IOException, KeyStoreException
getDN in interface SecureAdminHelpervalue - user-provided value (alias name or the actual DN)isAlias - whether the value is an aliasIOException - 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 certificatepublic void validateInternalUsernameAndPasswordAlias(String username, String passwordAlias)
validateInternalUsernameAndPasswordAlias in interface SecureAdminHelperusername - user-provided usernamepasswordAlias - name of the password aliaspublic boolean isAnyAdminUserWithoutPassword()
throws Exception
isAnyAdminUserWithoutPassword in interface SecureAdminHelperBadRealmExceptionNoSuchRealmExceptionNoSuchUserExceptionExceptionCopyright © 2017. All rights reserved.