Package org.apache.ftpserver.usermanager

Examples of org.apache.ftpserver.usermanager.SaltedPasswordEncryptor


public class ManagingUsers {

    public static void main(String[] args) throws Exception {
        PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
        userManagerFactory.setFile(new File("myusers.properties"));
        userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
        UserManager um = userManagerFactory.createUserManager();

        UserFactory userFact = new UserFactory();
        userFact.setName("myNewUser");
        userFact.setPassword("secret");
View Full Code Here


            String encryptionStrategy = element.getAttribute("encrypt-passwords");
           
            if(encryptionStrategy.equals("true") || encryptionStrategy.equals("md5")) {
                factoryBuilder.addPropertyValue("passwordEncryptor", new Md5PasswordEncryptor());
            } else if(encryptionStrategy.equals("salted")) {
                factoryBuilder.addPropertyValue("passwordEncryptor", new SaltedPasswordEncryptor());
            } else {
                factoryBuilder.addPropertyValue("passwordEncryptor", new ClearTextPasswordEncryptor());
            }
        }
       
View Full Code Here

*/
public class SaltedPasswordEncryptorTest extends ClearTextPasswordEncryptorTest {

    @Override
    protected PasswordEncryptor createPasswordEncryptor() {
        return new SaltedPasswordEncryptor();
    }
View Full Code Here

            if (!myUsersProperties.exists()) {
                myUsersProperties.createNewFile();
                createNewUsers = true;
            }
            userManagerFactory.setFile(myUsersProperties);
            userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
            UserManager um = userManagerFactory.createUserManager();

            if (createNewUsers) {
                List<Authority> auths = new ArrayList<Authority>();
                Authority auth = new WritePermission();
View Full Code Here

*/
public class SaltedPasswordEncryptorTest extends ClearTextPasswordEncryptorTest {

    @Override
    protected PasswordEncryptor createPasswordEncryptor() {
        return new SaltedPasswordEncryptor();
    }
View Full Code Here

            String encryptionStrategy = element.getAttribute("encrypt-passwords");
           
            if(encryptionStrategy.equals("true") || encryptionStrategy.equals("md5")) {
                factoryBuilder.addPropertyValue("passwordEncryptor", new Md5PasswordEncryptor());
            } else if(encryptionStrategy.equals("salted")) {
                factoryBuilder.addPropertyValue("passwordEncryptor", new SaltedPasswordEncryptor());
            } else {
                factoryBuilder.addPropertyValue("passwordEncryptor", new ClearTextPasswordEncryptor());
            }
        }
       
View Full Code Here

public class ManagingUsers {

    public static void main(String[] args) throws Exception {
        PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
        userManagerFactory.setFile(new File("myusers.properties"));
        userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
        UserManager um = userManagerFactory.createUserManager();
       
        UserFactory userFact = new UserFactory();
        userFact.setName("myNewUser");
        userFact.setPassword("secret");
View Full Code Here

*/
public class SaltedPasswordEncryptorTest extends ClearTextPasswordEncryptorTest {

    @Override
    protected PasswordEncryptor createPasswordEncryptor() {
        return new SaltedPasswordEncryptor();
    }
View Full Code Here

public class ManagingUsers {

    public static void main(String[] args) throws Exception {
        PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
        userManagerFactory.setFile(new File("myusers.properties"));
        userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
        UserManager um = userManagerFactory.createUserManager();
       
        BaseUser user = new BaseUser();
        user.setName("myNewUser");
        user.setPassword("secret");
View Full Code Here

            String encryptionStrategy = element.getAttribute("encrypt-passwords");
           
            if(encryptionStrategy.equals("true") || encryptionStrategy.equals("md5")) {
                factoryBuilder.addPropertyValue("passwordEncryptor", new Md5PasswordEncryptor());
            } else if(encryptionStrategy.equals("salted")) {
                factoryBuilder.addPropertyValue("passwordEncryptor", new SaltedPasswordEncryptor());
            } else {
                factoryBuilder.addPropertyValue("passwordEncryptor", new ClearTextPasswordEncryptor());
            }
        }
       
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.usermanager.SaltedPasswordEncryptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.