Package dubious.sub.goobi.helper.encryption

Examples of dubious.sub.goobi.helper.encryption.DesEncrypter


  }


  public void PasswoerterVerschluesseln() {
    try {
      DesEncrypter encrypter = new DesEncrypter();
      BenutzerDAO dao = new BenutzerDAO();
      List<Benutzer> myBenutzer = dao.search("from Benutzer");
      for (Benutzer ben : myBenutzer) {
        String passencrypted = encrypter.encrypt(ben.getPasswort());
        ben.setPasswort(passencrypted);
        dao.save(ben);
      }
      Helper.setMeldung(null, "", "passwords successful ciphered");
    } catch (Exception e) {
View Full Code Here


  }
 
  @Test
  public void encryptTest () {
    for (String clearText: testData.keySet()) {
      String encrypted = new DesEncrypter().encrypt(clearText);
      assertTrue("Encrypted Password doesn't match the precomputed one!", encrypted.equals(testData.get(clearText)));
    }
  }
View Full Code Here

  }

  @Test
  public void decryptTest () {
    for (String clearText: testData.keySet()) {
      String decrypted = new DesEncrypter().decrypt(testData.get(clearText));
      assertTrue("Decrypted Password doesn't match the given plain text", decrypted.equals(clearText));
    }
  }
View Full Code Here

  public void setPasswort(String inpasswort) {
    this.passwort = inpasswort;
  }

  public String getPasswortCrypt() {
    DesEncrypter encrypter = new DesEncrypter();
    String decrypted = encrypter.decrypt(this.passwort);
    return decrypted;
  }
View Full Code Here

    String decrypted = encrypter.decrypt(this.passwort);
    return decrypted;
  }

  public void setPasswortCrypt(String inpasswort) {
    DesEncrypter encrypter = new DesEncrypter();
    String encrypted = encrypter.encrypt(inpasswort);
    this.passwort = encrypted;
  }
View Full Code Here

      if (ConfigMain.getBooleanParameter("ldap_use")) {
        Ldap myldap = new Ldap();
        return myldap.isUserPasswordCorrect(this, inPasswort);
      } else {
        DesEncrypter encrypter = new DesEncrypter();
        String encoded = encrypter.encrypt(inPasswort);
        return this.passwort.equals(encoded);
      }
    }
  }
View Full Code Here

TOP

Related Classes of dubious.sub.goobi.helper.encryption.DesEncrypter

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.