Fix coding issues

This commit is contained in:
AsamK 2015-08-07 13:22:15 +02:00
parent e1b584ab84
commit 9e1cd7e398
9 changed files with 19 additions and 23 deletions

View file

@ -3,19 +3,19 @@ package cli;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
public class Util {
class Util {
public static String getSecret(int size) {
byte[] secret = getSecretBytes(size);
return Base64.encodeBytes(secret);
}
public static byte[] getSecretBytes(int size) {
private static byte[] getSecretBytes(int size) {
byte[] secret = new byte[size];
getSecureRandom().nextBytes(secret);
return secret;
}
public static SecureRandom getSecureRandom() {
private static SecureRandom getSecureRandom() {
try {
return SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException e) {