Search in sources :

Example 1 with HashProcessor

use of org.apache.activemq.artemis.utils.HashProcessor in project activemq-artemis by apache.

the class ArtemisTest method checkPassword.

private boolean checkPassword(String user, String password, File userFile) throws Exception {
    Configurations configs = new Configurations();
    FileBasedConfigurationBuilder<PropertiesConfiguration> userBuilder = configs.propertiesBuilder(userFile);
    PropertiesConfiguration userConfig = userBuilder.getConfiguration();
    String storedPassword = (String) userConfig.getProperty(user);
    HashProcessor processor = PasswordMaskingUtil.getHashProcessor(storedPassword);
    return processor.compare(password.toCharArray(), storedPassword);
}
Also used : HashProcessor(org.apache.activemq.artemis.utils.HashProcessor) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) Configurations(org.apache.commons.configuration2.builder.fluent.Configurations) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration)

Aggregations

SimpleString (org.apache.activemq.artemis.api.core.SimpleString)1 HashProcessor (org.apache.activemq.artemis.utils.HashProcessor)1 PropertiesConfiguration (org.apache.commons.configuration2.PropertiesConfiguration)1 Configurations (org.apache.commons.configuration2.builder.fluent.Configurations)1