Examples of PasswordException


Examples of org.openqreg.exception.PasswordException

    String result = null;
    try {
      cipher.init(Cipher.ENCRYPT_MODE, key);
      result = new String(Base64.encodeBase64(cipher.doFinal(data)));
    } catch (Exception e) {
      throw new PasswordException("Can't encrypt message because of:\n"
          + e.toString());
    }
    return result;

  }
View Full Code Here

Examples of org.openqreg.exception.PasswordException

    try {
      if (encrypt(plaintext).equals(encryptedtext)) {
        return true;
      }
    } catch (PasswordException pe) {
      throw new PasswordException(pe.toString());
    }
    return false;
  }
View Full Code Here

Examples of org.openqreg.exception.PasswordException

      MessageDigest md5 = MessageDigest.getInstance("SHA");
      md5.update(text.getBytes("UTF-8"));
      byte[] doHash = md5.digest();
      result = new String(new Base64().encode(doHash));
    } catch (Exception e) {
      throw new PasswordException("couldn't make digest because of:\n" + e);
    }
    return result;

  }
View Full Code Here

Examples of org.openqreg.exception.PasswordException

    try {
      if ((generateHash(plainText)).equals(hashCode)) {
        return true;
      }
    } catch (Exception e) {
      throw new PasswordException("Can't compare passwords because of: \n"
          + e.toString());
    }
    return false;
  }
View Full Code Here

Examples of tifauv.jplop.core.auth.PasswordException

  /**
   * Test method for {@link tifauv.jplop.board.PasswordException#PasswordException(java.lang.String)}.
   */
  public void testPasswordExceptionString() {
    // Check without message
    Exception e = new PasswordException(null);
    assertNull(e.getMessage());

    // Check with a message
    e = new PasswordException("plop pikaron");
    assertEquals("plop pikaron", e.getMessage());
  }
View Full Code Here

Examples of tifauv.jplop.core.auth.PasswordException

  /**
   * Test method for {@link tifauv.jplop.board.PasswordException#PasswordException(java.lang.String, java.lang.Throwable)}.
   */
  public void testPasswordExceptionStringThrowable() {
    // Check without message and cause
    Exception e = new PasswordException(null, null);
    assertNull(e.getMessage());
    assertNull(e.getCause());

    // Check with a message only
    e = new PasswordException("plop pikaron", null);
    assertEquals("plop pikaron", e.getMessage());
    assertNull(e.getCause());

    // Check with a cause only
    Exception cause = new Exception();
    e = new PasswordException(null, cause);
    assertNull(e.getMessage());
    assertEquals(cause, e.getCause());

    // Check with a message only
    e = new PasswordException("plop pikaron", cause);
    assertEquals("plop pikaron", e.getMessage());
    assertEquals(cause, e.getCause());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.