X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/0744dcccf117064dcf6c8dbb1312565c0f3e15cb..d91e20e1f8a8626ce8e5d5f11535dc05f3c63f31:/src/main/java/org/asamk/signal/Util.java diff --git a/src/main/java/org/asamk/signal/Util.java b/src/main/java/org/asamk/signal/Util.java deleted file mode 100644 index 4eeabf1c..00000000 --- a/src/main/java/org/asamk/signal/Util.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.asamk.signal; - -import java.io.File; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; - -class Util { - public static String getSecret(int size) { - byte[] secret = getSecretBytes(size); - return Base64.encodeBytes(secret); - } - - public static byte[] getSecretBytes(int size) { - byte[] secret = new byte[size]; - getSecureRandom().nextBytes(secret); - return secret; - } - - private static SecureRandom getSecureRandom() { - try { - return SecureRandom.getInstance("SHA1PRNG"); - } catch (NoSuchAlgorithmException e) { - throw new AssertionError(e); - } - } - - public static File createTempFile() throws IOException { - return File.createTempFile("signal_tmp_", ".tmp"); - } -}