Class NativeRandom

java.lang.Object
org.apache.kerby.kerberos.kerb.crypto.random.NativeRandom
All Implemented Interfaces:
RandomProvider

public class NativeRandom extends Object implements RandomProvider
use "/dev/urandom", which is on linux, to implement RandomProvider, so it should be used on linux.
  • Constructor Details

    • NativeRandom

      public NativeRandom()
  • Method Details

    • init

      public void init()
      Description copied from interface: RandomProvider
      To init.
      Specified by:
      init in interface RandomProvider
    • setSeed

      public void setSeed(byte[] seed)
      Description copied from interface: RandomProvider
      Provide entropy seed for the provider.
      Specified by:
      setSeed in interface RandomProvider
      Parameters:
      seed - The seed
    • nextBytes

      public void nextBytes(byte[] bytes)
      Description copied from interface: RandomProvider
      Generate random bytes into the specified array.
      Specified by:
      nextBytes in interface RandomProvider
      Parameters:
      bytes - The bytes
    • destroy

      public void destroy()
      Description copied from interface: RandomProvider
      To clean up.
      Specified by:
      destroy in interface RandomProvider