Class FixedSecureRandom

  • All Implemented Interfaces:
    java.io.Serializable

    public final class FixedSecureRandom
    extends java.security.SecureRandom
    Older versions of Android have a SecureRandom that isn't actually secure. This class implements a workaround. Call the static get() method to get a secure SecureRandom instance.

    This workaround code was recommended by Google in a euphemistically-titled blog post. Our code is slightly different because we're a library so we don't want to change global JVM settings.

    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.security.SecureRandom get()  
      • Methods inherited from class java.security.SecureRandom

        generateSeed, getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, nextBytes, reseed, reseed, setSeed, setSeed, toString
      • Methods inherited from class java.util.Random

        doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • get

        public static java.security.SecureRandom get()