Examples of PasswordHash


Examples of lineage2.loginserver.crypt.PasswordHash

   * Method initCrypt.
   * @throws Throwable
   */
  public static void initCrypt() throws Throwable
  {
    DEFAULT_CRYPT = new PasswordHash(Config.DEFAULT_PASSWORD_HASH);
    List<PasswordHash> legacy = new ArrayList<>();
    for (String method : Config.LEGACY_PASSWORD_HASH.split(";"))
    {
      if (!method.equalsIgnoreCase(Config.DEFAULT_PASSWORD_HASH))
      {
        legacy.add(new PasswordHash(method));
      }
    }
    LEGACY_CRYPT = legacy.toArray(new PasswordHash[legacy.size()]);
    _log.info("Loaded " + Config.DEFAULT_PASSWORD_HASH + " as default crypt.");
    _keyPairs = new ScrambledKeyPair[Config.LOGIN_RSA_KEYPAIRS];
View Full Code Here

Examples of org.dspace.eperson.PasswordHash

                if (null != salt)
                    saltText = salt.getNodeValue();
                else
                    saltText = null;

                PasswordHash password;
                try {
                    password = new PasswordHash(algorithmText, saltText, element.getTextContent());
                } catch (DecoderException ex) {
                    throw new PackageValidationException("Unable to decode hexadecimal password hash or salt", ex);
                }
                eperson.setPasswordHash(password);
            }
View Full Code Here

Examples of org.dspace.eperson.PasswordHash

            writer.writeEndElement();
        }
       
        if (emitPassword)
        {
            PasswordHash password = eperson.getPasswordHash();
            if (null != password)
            {
                writer.writeStartElement(PASSWORD_HASH);

                String algorithm = password.getAlgorithm();
                if (null != algorithm)
                {
                    writer.writeAttribute(PASSWORD_DIGEST, algorithm);
                }

                String salt = password.getSaltString();
                if (null != salt)
                {
                    writer.writeAttribute(PASSWORD_SALT, salt);
                }

                writer.writeCharacters(password.getHashString());
                writer.writeEndElement();
            }
        }

        if (eperson.canLogIn())
View Full Code Here

Examples of org.jboss.seam.security.management.PasswordHash

{  
   @SuppressWarnings("deprecation")
   @Test
   public void testMd5Hash()
   {
      PasswordHash passwordHash = new PasswordHash();
      String hash = passwordHash.generateHash("secret", "MD5");
      assert hash.equals("Xr4ilOzQ4PCOq3aQ0qbuaQ==");
   }
View Full Code Here

Examples of org.jboss.seam.security.management.PasswordHash

  
   @SuppressWarnings("deprecation")
   @Test
   public void testShaHash()
   {
      PasswordHash passwordHash = new PasswordHash();
      String hash = passwordHash.generateHash("secret", "SHA");
      assert hash.equals("5en6G6MezRroT3XKqkdPOmY/BfQ=");
   }
View Full Code Here

Examples of org.jboss.seam.security.management.PasswordHash

                String username = rset.getString("username");
                String passwordHash = rset.getString("passwordHash");
                // Deprecated, but it's the same method used to generate
                // passwords on the rest of Zanata
                String emptyPasswordHash =
                        new PasswordHash().generateSaltedHash("", username,
                                PasswordHash.ALGORITHM_MD5);

                if (emptyPasswordHash.equals(passwordHash)) {
                    emptyPasswordsFound++;
                    rset.updateString("passwordHash", null);
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.