Class JCERandom

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

public class JCERandom extends Object implements Random
A Random implementation using the built-in SecureRandom PRNG.
  • Nested Class Summary

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

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
    private final SecureRandom
     
    private byte[]
     
  • 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[] foo, int start, int len)
    Fill the given byte-array with random bytes from this PRNG.

    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
    • tmp

      private byte[] tmp
    • random

      private final SecureRandom random
  • Constructor Details

    • JCERandom

      JCERandom()
  • Method Details

    • fill

      public void fill(byte[] foo, int start, int len)
      Fill the given byte-array with random bytes from this PRNG.
      Specified by:
      fill in interface Random
      Parameters:
      foo - the byte-array
      start - the offset to start at
      len - the number of bytes 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.