Package com.atlassian.security.random
Class SecureRandomFactory
java.lang.Object
com.atlassian.security.random.SecureRandomFactory
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
Modifier and TypeMethodDescriptionstatic SecureRandomCreates and fully initialises a newSecureRandominstance.
-
Method Details
-
newInstance
Creates and fully initialises a newSecureRandominstance.The instance is created via
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
SecureRandominstance.
-