@Test public void testRandomNames() { for (int i = 0; i < 100; i++) { for (int j = 0; j < 10; j++) { String str = SideKEK.getRandomAlphanumericString(i); for (int x = 0; x < str.length(); x++) { assertEquals("Size is not the expected value", i, str.length()); char c = str.charAt(x); if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (c == '-') || (c == '_')) { continue; } fail("String is not fully alphanumeric: " + str); } } } }
static String getRandomAlphanumericString(int length) { if (length <= 0) { return ""; } byte[] bytes = getRandomBytes(length); byte[] encodedBytes = Base64.getUrlEncoder().withoutPadding().encode(bytes); return new String(encodedBytes, 0, length); }
SideKEK extends Provider { static String getRandomAlphanumericString(int length) { if (length <= 0) { return ""; } byte[] bytes = getRandomBytes(length); byte[] encodedBytes = Base64.getUrlEncoder().withoutPadding().encode(bytes); return new String(encodedBytes, 0, length); } }
SideKEK extends Provider { static String getRandomAlphanumericString(int length) { if (length <= 0) { return ""; } byte[] bytes = getRandomBytes(length); byte[] encodedBytes = Base64.getUrlEncoder().withoutPadding().encode(bytes); return new String(encodedBytes, 0, length); } SideKEK(); }
SideKEK extends Provider { static String getRandomAlphanumericString(int length) { if (length <= 0) { return ""; } byte[] bytes = getRandomBytes(length); byte[] encodedBytes = Base64.getUrlEncoder().withoutPadding().encode(bytes); return new String(encodedBytes, 0, length); } SideKEK();  }
SideKEK extends Provider { static String getRandomAlphanumericString(int length) { if (length <= 0) { return ""; } byte[] bytes = getRandomBytes(length); byte[] encodedBytes = Base64.getUrlEncoder().withoutPadding().encode(bytes); return new String(encodedBytes, 0, length); } SideKEK();  static final String TIMESTAMP_KEYSTORE; static final String SECRET_FOLDER_KEYSTORE; }