@Test(expected = NegativeArraySizeException.class) public void testRandomAlphanumericException() throws Exception { SecurityUtils.randomAlphanumeric(-1); }
public static String randomAlphanumeric(int length) { StringBuilder buffer = new StringBuilder(length); SecureRandom secureRandom = new SecureRandom(); for (int i = 0; i < length; i++) { double number = secureRandom.nextDouble(); int b = ((int) (number * ALPHANUM_ARRAY.length)); buffer.append(ALPHANUM_ARRAY[b]); } return buffer.toString(); }
SecurityUtils { public static String randomAlphanumeric(int length) { StringBuilder buffer = new StringBuilder(length); SecureRandom secureRandom = new SecureRandom(); for (int i = 0; i < length; i++) { double number = secureRandom.nextDouble(); int b = ((int) (number * ALPHANUM_ARRAY.length)); buffer.append(ALPHANUM_ARRAY[b]); } return buffer.toString(); } }
SecurityUtils { public static String randomAlphanumeric(int length) { StringBuilder buffer = new StringBuilder(length); SecureRandom secureRandom = new SecureRandom(); for (int i = 0; i < length; i++) { double number = secureRandom.nextDouble(); int b = ((int) (number * ALPHANUM_ARRAY.length)); buffer.append(ALPHANUM_ARRAY[b]); } return buffer.toString(); }  }
SecurityUtils { public static String randomAlphanumeric(int length) { StringBuilder buffer = new StringBuilder(length); SecureRandom secureRandom = new SecureRandom(); for (int i = 0; i < length; i++) { double number = secureRandom.nextDouble(); int b = ((int) (number * ALPHANUM_ARRAY.length)); buffer.append(ALPHANUM_ARRAY[b]); } return buffer.toString(); }  static String randomAlphanumeric(int length); static void logOpenSslExitCode(String command, int exitCode); static String hideOpenSslPassword(String command); static String getOpenSslCommandResult(String command, int exitCode); static void writeCaConfigFile(String path); static String getKeystorePass(); static String getSecurityDir(); static void initializeSecurityParameters(MapOperations configMap); static void initializeSecurityParameters(MapOperations configMap,
                                                boolean persistPassword); static void cleanupSecurityDir(); }
SecurityUtils { public static String randomAlphanumeric(int length) { StringBuilder buffer = new StringBuilder(length); SecureRandom secureRandom = new SecureRandom(); for (int i = 0; i < length; i++) { double number = secureRandom.nextDouble(); int b = ((int) (number * ALPHANUM_ARRAY.length)); buffer.append(ALPHANUM_ARRAY[b]); } return buffer.toString(); }  static String randomAlphanumeric(int length); static void logOpenSslExitCode(String command, int exitCode); static String hideOpenSslPassword(String command); static String getOpenSslCommandResult(String command, int exitCode); static void writeCaConfigFile(String path); static String getKeystorePass(); static String getSecurityDir(); static void initializeSecurityParameters(MapOperations configMap); static void initializeSecurityParameters(MapOperations configMap,
                                                boolean persistPassword); static void cleanupSecurityDir(); static final String UPPER; static final String LOWER; static final String DIGITS; static final String ALPHANUM; static final char[] ALPHANUM_ARRAY; }