+ private static Logger log = LoggerFactory.getLogger(UserConfig.class);
+ private static final boolean strongPasswordCheck = Boolean.getBoolean("enableStrongPasswordCheck");
+ private static final String DIGEST_ALGORITHM = "SHA-384";
+ private static final String BAD_PASSWORD = "Bad Password";
+ private static final int USERNAME_MAXLENGTH = 32;
+ protected static final String PASSWORD_REGEX = "(?=.*[^a-zA-Z0-9])(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,256}$";
+ private static final Pattern INVALID_USERNAME_CHARACTERS = Pattern.compile("([/\\s\\.\\?#%;\\\\]+)");
+ private static MessageDigest oneWayFunction;
+
+ static {
+ try {
+ UserConfig.oneWayFunction = MessageDigest.getInstance(DIGEST_ALGORITHM);
+ } catch (NoSuchAlgorithmException e) {
+ log.error(String.format("Implementation of %s digest algorithm not found: %s", DIGEST_ALGORITHM,
+ e.getMessage()));
+ }
+ }