use of com.sun.enterprise.security.store.PasswordAdapter in project Payara by payara.
the class RepositoryManager method validateMasterPassword.
/**
* We validate the master password by trying to open the password alias
* keystore. This means that the keystore must already exist.
*
* @param config
* @param password
* @throws RepositoryException
*/
public void validateMasterPassword(RepositoryConfig config, String password) throws RepositoryException {
final PEFileLayout layout = getFileLayout(config);
final File passwordAliases = layout.getPasswordAliasKeystore();
try {
// WBN July 2007
// we are constructing this object ONLY to see if it throws
// an Exception. We do not use the object.
new PasswordAdapter(passwordAliases.getAbsolutePath(), password.toCharArray());
} catch (IOException ex) {
throw new RepositoryException(_strMgr.getString("masterPasswordInvalid"));
} catch (Exception ex) {
throw new RepositoryException(_strMgr.getString("couldNotValidateMasterPassword", passwordAliases), ex);
}
}
Aggregations