List of usage examples for java.security SecureRandom getProvider
public final Provider getProvider()
From source file:Main.java
public static void main(String[] args) throws NoSuchAlgorithmException { int numBytes = (new Integer("1111")).intValue(); SecureRandom srand = new SecureRandom(new byte[] { 1, 2, 3, 4 }); Provider provider = srand.getProvider(); System.out.println(provider.getName()); byte[] bytes = new byte[numBytes]; srand.nextBytes(bytes);// w w w . java 2 s. c o m System.out.println(bytes); }
From source file:Main.java
public static void main(String[] args) throws NoSuchAlgorithmException { int numBytes = (new Integer("1111")).intValue(); SecureRandom srand = new SecureRandom(new byte[] { 1, 2, 3, 4 }); Provider provider = srand.getProvider(); SecureRandom newRandom = SecureRandom.getInstance("SHA1PRNG", provider); System.out.println(provider.getName()); byte[] bytes = new byte[numBytes]; srand.nextBytes(bytes);// w ww . ja va 2 s . c om System.out.println(bytes); }