コード例 #1
0
  private void generatePlaintextSaltAndHash(UserPassword userPassword) {
    String random = stringGenerator.generateRandomAlphanumeric();
    String plaintext = substring(random, plaintextBeginning, plaintextEnd);
    String salt = createSalt(random);
    String hash = getHash(plaintext, salt);

    populateUserPassword(userPassword, plaintext, salt, hash);
  }
コード例 #2
0
  @Override
  public void createUserPassword(String plaintext, UserPassword userPassword) {
    String random = stringGenerator.generateRandomAlphanumeric();
    String salt = createSalt(random);
    String hash = getHash(plaintext, salt);

    populateUserPassword(userPassword, plaintext, salt, hash);
  }