Package com.knowgate.misc

Examples of com.knowgate.misc.MD5


  // ---------------------------------------------------------------------------

  public static String computeContentMD5(byte[] byArray) {
    String sContentMD5;
    MD5 oMd5 = new MD5();
    oMd5.Init();
    oMd5.Update(byArray);
    sContentMD5 = Gadgets.toHexString(oMd5.Final());
    oMd5 = null;
    return sContentMD5;
  }
View Full Code Here


    short iRetVal;
    long lNow = new Date().getTime();
    if (lTimestamp+lTimeout<lNow) {
      iRetVal = CAPTCHA_TIMEOUT;
    } else {
      MD5 oCaptchaMd5 = new MD5(sPlainCaptcha+ACL.getRC4key());
      if (sPlainCaptchaMD5.equalsIgnoreCase(oCaptchaMd5.asHex()))
      iRetVal = (short) 0;
    else
        iRetVal = CAPTCHA_MISMATCH;
    } // fi (lTimestamp+lCaptchaTimeout<lNow)
    return iRetVal;
View Full Code Here

  }

  @ValidationMethod(on="save")
  public void validate(ValidationErrors errors) {

    MD5 oMD5 = new MD5(getCaptcha()+ACL.getRC4key());

    if (!oMD5.asHex().equals(getSessionAttribute("captcha_key")) && false) {

      try {
        connect();
        DAO.log(getSession(), user.getClass(), "CAPTCHA MISMATCH", AtrilEvent.Level.WARNING, ";"+user.getEmail());
        disconnect();
      } catch (StorageException ignore) { }

      Log.out.warn("Captch mismatch: signature "+oMD5.asHex()+" for text "+getCaptcha()+" does not match session signature "+getSessionAttribute("captcha_key"));

      errors.add("captcha", new LocalizableError("com.zesped.action.SignUpForm.captchaMismatch"));      

    } else {
   
View Full Code Here

TOP

Related Classes of com.knowgate.misc.MD5

Copyright © 2018 www.massapicom. 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.