/** * Get SecureRandom instance for creation of random number. * * @param algo * the String algorithm specification (e.g. "SHA1PRNG") for * creation of the SecureRandom instance * @param provider * the provider of the implementation of the given algorighm * (e.g. "SUN") * @return SecureRandom * @exception Exception * thrown if SecureRandom instance cannot be created/accessed */ protected static synchronized SecureRandom getRandom(String algo, String provider) throws Exception { // Given algo and provider, get SecureRandom instance if (random == null) { initializeRandom(algo, provider); } return random; }
/** * Get SecureRandom instance for creation of random number. * * @param algo * the String algorithm specification (e.g. "SHA1PRNG") for * creation of the SecureRandom instance * @param provider * the provider of the implementation of the given algorighm * (e.g. "SUN") * @return SecureRandom * @exception Exception * thrown if SecureRandom instance cannot be created/accessed */ protected static synchronized SecureRandom getRandom(String algo, String provider) throws Exception { // Given algo and provider, get SecureRandom instance if (random == null) { initializeRandom(algo, provider); } return random; }