public boolean match(String clearTextPassword,String encpassword){
  if (StringUtils.startsWith(encpassword,Constants.CRYPT_SHA_512)) {
    String hashedValue=Crypt.crypt(clearTextPassword,encpassword);
    return encpassword.equals(hashedValue);
  }
 else {
    String encryptedValue=encryptionProvider.getEncryptedString(clearTextPassword);
    return encpassword.equals(encryptedValue);
  }
}

public boolean match ( String clearTextPassword , String encpassword ) { if ( StringUtils . startsWith ( encpassword , Constants . CRYPT_SHA_512 ) ) { String hashedValue = Crypt . crypt ( clearTextPassword , encpassword ) ; return encpassword . equals ( hashedValue ) ; } else { String encryptedValue = encryptionProvider . getEncryptedString ( clearTextPassword ) ; return encpassword . equals ( encryptedValue ) ; } }
check if two passwords match , one parameter is in clear text , the other is encoded .
