/**
 * 
 */
package kcg.imis.sec;

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

/**
  * @FileName : ShaPasswordEncoderEx.java
  * @Project : 국제해양프로젝트
  * @Date : 2018. 3. 29. 
  * @작성자 : Moon
  * @변경이력 : 
  * @프로그램 설명 :
 */
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);
    }
}
