/**
 * 
 */
package kcg.faics.sec;

import org.apache.commons.lang.StringUtils;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;

/**
 * @author kimnomin
 *
 */
public class ShaPasswordEncoderEx extends ShaPasswordEncoder {
	
    /**
     * 생성자.
     * 
     * @param strength SHA Strength
     */
    public ShaPasswordEncoderEx(final int strength) {
        super(strength);
    }
    
	@Override
    public boolean isPasswordValid(final String encPass, final String rawPass, final Object salt) {
        String pass1 = "" + encPass;
        String pass2 = encodePassword(rawPass, salt);

        return StringUtils.equalsIgnoreCase(pass1, pass2);
    }
}
