package com.rjconsultores.ventaboletos.utilerias.spring.security;

import org.springframework.dao.DataAccessException;
import org.springframework.security.authentication.encoding.PasswordEncoder;

import com.rjconsultores.ventaboletos.utilerias.seguridad.ContrasenaUtileria;

public class MiPasswordEncoder implements PasswordEncoder {

	public String encodePassword(String pwd, Object salt) throws DataAccessException {
		return ContrasenaUtileria.encriptarContrasena(pwd);

	}

	public boolean isPasswordValid(String encPass, String pwd, Object salt) throws DataAccessException {
		return encodePassword(pwd, salt).equals(encPass);
	}

}
