Class BouncyCastleRandom

java.lang.Object
net.schmizz.sshj.transport.random.BouncyCastleRandom
All Implemented Interfaces:
Random

public class BouncyCastleRandom extends Object implements Random
BouncyCastle Random. This pseudo random number generator uses the a very fast PRNG from BouncyCastle. The JRE random will be used when creating a new generator to add some random data to the seed.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Named factory for the BouncyCastle Random
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
    private final org.bouncycastle.crypto.prng.RandomGenerator
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fill(byte[] bytes)
    Fill the array of bytes with random values.
    void
    fill(byte[] bytes, int start, int len)
    Fill part of bytes with random values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • random

      private final org.bouncycastle.crypto.prng.RandomGenerator random
  • Constructor Details

    • BouncyCastleRandom

      public BouncyCastleRandom()
  • Method Details

    • fill

      public void fill(byte[] bytes, int start, int len)
      Description copied from interface: Random
      Fill part of bytes with random values.
      Specified by:
      fill in interface Random
      Parameters:
      bytes - byte array to be filled.
      start - index to start filling at.
      len - length of segment to fill.
    • fill

      public void fill(byte[] bytes)
      Description copied from interface: Random
      Fill the array of bytes with random values.
      Specified by:
      fill in interface Random
      Parameters:
      bytes - byte array to be filled.