Example usage for org.bouncycastle.crypto.prng ThreadedSeedGenerator ThreadedSeedGenerator

List of usage examples for org.bouncycastle.crypto.prng ThreadedSeedGenerator ThreadedSeedGenerator

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.prng ThreadedSeedGenerator ThreadedSeedGenerator.

Prototype

ThreadedSeedGenerator

Source Link

Usage

From source file:org.crypto.sse.CryptoPrimitives.java

License:Open Source License

public static byte[] randomBytes(int sizeOfSalt) {
    byte[] salt = new byte[sizeOfSalt];
    ThreadedSeedGenerator thread = new ThreadedSeedGenerator();
    SecureRandom random = new SecureRandom();
    random.setSeed(thread.generateSeed(20, true));
    random.nextBytes(salt);/* ww w . ja v a2 s.  c  o m*/
    return salt;
}