Rename to signal-cli

Changes experimental dbus interface from
org.asamk.TextSecure to org.asamk.Signal
This commit is contained in:
AsamK 2016-03-27 13:53:04 +02:00
parent 10719a443a
commit eabd361405
27 changed files with 108 additions and 108 deletions

View file

@ -0,0 +1,25 @@
package org.asamk.signal;
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);
}
}
}