Package uk.org.woodcraft.bookings.auth

Source Code of uk.org.woodcraft.bookings.auth.SignupUtils

package uk.org.woodcraft.bookings.auth;

import org.jasypt.digest.StandardStringDigester;

import uk.org.woodcraft.bookings.datamodel.User;

public class SignupUtils {
  public static String generateEmailConfirmHash(User user)
  {
    //FIXME: This should really use its own salt, but this is sufficient for now, since the encrypted password uses a salt
    StandardStringDigester digestor = new StandardStringDigester();
    return digestor.digest(user.getName() + user.getPasswordEncrypted())
  }
 
  public static boolean checkEmailHash(User user, String hash)
  {
    StandardStringDigester digestor = new StandardStringDigester();
    return digestor.matches(user.getName() + user.getPasswordEncrypted(), hash)
  }
}
TOP

Related Classes of uk.org.woodcraft.bookings.auth.SignupUtils

TOP
Copyright © 2018 www.massapi.com. 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.