com.atlassian.security.random
Class SecureRandomFactory

java.lang.Object
  extended by com.atlassian.security.random.SecureRandomFactory

public final class SecureRandomFactory
extends java.lang.Object

A factory which returns properly initialised instances of SecureRandom.

Clients should not access this class directly, but instead use SecureRandomService or SecureTokenGenerator for their random data generation.


Method Summary
static java.security.SecureRandom newInstance()
          Creates and fully initialises a new SecureRandom instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static java.security.SecureRandom newInstance()
Creates and fully initialises a new SecureRandom instance.

The instance is created via SecureRandom.SecureRandom(), which uses the default algorithm provided by the JVM.

The initialisation involves forcing the self-seeding of the instance by calling SecureRandom.nextBytes(byte[]).

Returns:
self-seeded SecureRandom instance.


Copyright © 2010 Atlassian. All Rights Reserved.