Class Random


  • public final class Random
    extends java.lang.Object
    Provides secure randomness using SecureRandom.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] randBytes​(int size)
      Returns a random byte array of size size.
      static int randInt()  
      static int randInt​(int max)  
      static void validateUsesConscrypt()
      Throws a GeneralSecurityException if the provider is not Conscrypt.
      • Methods inherited from class java.lang.Object

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

      • randBytes

        public static byte[] randBytes​(int size)
        Returns a random byte array of size size.
      • randInt

        public static final int randInt​(int max)
      • randInt

        public static final int randInt()
      • validateUsesConscrypt

        public static final void validateUsesConscrypt()
                                                throws java.security.GeneralSecurityException
        Throws a GeneralSecurityException if the provider is not Conscrypt.
        Throws:
        java.security.GeneralSecurityException