Package com.infotech.common.utils

Examples of com.infotech.common.utils.SHACrypto


  @Test
  public void testCryp() {
     String passwd = "opq";
    int MAX_PWD_LENGTH = 64;
    try {
      String e1 = new SHACrypto().getHexEncryptString(passwd, MAX_PWD_LENGTH);
      System.out.println("e1= " + e1);
      String e2 = new SHACrypto().getHexEncryptString(passwd, MAX_PWD_LENGTH);
      System.out.println("e2= " + e2);
     
    } catch (NoSuchAlgorithmException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here


   * @param profile
   */
  private void initUserAccount (String account, String password, String token, UserProfile profile) {
    this.account = account;
    try {
      this.password = new SHACrypto().getHexEncryptString(password, MAX_PWD_LENGTH);
    } catch (Exception e) {
      //e.printStackTrace();
      this.password = password;
    }
    //System.out.println(this.password);
View Full Code Here

   * @return
   */
  public boolean isValidPassword(String passwd) {
    String encPasswd;
    try {
      encPasswd = new SHACrypto().getHexEncryptString(passwd, MAX_PWD_LENGTH);
    } catch (Exception e) {
      encPasswd = password;
    }
    return (encPasswd != null && encPasswd.equals(this.getPassword()));
  }
View Full Code Here

TOP

Related Classes of com.infotech.common.utils.SHACrypto

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.