Top Description Fields Constructors Methods
org.apache.sshd.common.util.security.bouncycastle

public final Class BouncyCastleRandom

extends AbstractRandom
Class Inheritance
Imports
java.security.SecureRandom, org.apache.sshd.common.random.AbstractRandom, org.apache.sshd.common.util.ValidateUtils, org.apache.sshd.common.util.security.SecurityUtils, org.bouncycastle.crypto.prng.RandomGenerator, .VMPCRandomGenerator

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.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final String
private final RandomGenerator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
fill(byte[]
byte array to be filled.
bytes
,
int
index to start filling at.
start
,
int
length of segment to fill.
len
)

Implements org.apache.sshd.common.random.Random.fill.

Fill part of bytes with random values.

public String
private int
next(int numBits)

public int
random(int
The range upper limit
n
)

Implements org.apache.sshd.common.random.Random.random.

Returns a pseudo-random uniformly distributed int in the half-open range [0, n).

Inherited from org.apache.sshd.common.random.AbstractRandom:
toString

Field Detail

NAMEback to summary
public static final String NAME
randomback to summary
private final RandomGenerator random

Constructor Detail

BouncyCastleRandomback to summary
public BouncyCastleRandom()

Method Detail

fillback to summary
public void fill(byte[] bytes, int start, int len)

Implements org.apache.sshd.common.random.Random.fill.

Doc from org.apache.sshd.common.random.Random.fill.

Fill part of bytes with random values.

Parameters
bytes:byte[]

byte array to be filled.

start:int

index to start filling at.

len:int

length of segment to fill.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.apache.sshd.common.NamedResource.getName.

Returns:String

Doc from org.apache.sshd.common.NamedResource.getName.

The resource name

Annotations
@Override
nextback to summary
private int next(int numBits)
randomback to summary
public int random(int n)

Implements org.apache.sshd.common.random.Random.random.

Returns a pseudo-random uniformly distributed int in the half-open range [0, n).

Parameters
n:int

Doc from org.apache.sshd.common.random.Random.random.

The range upper limit

Returns:int

Doc from org.apache.sshd.common.random.Random.random.

The randomly selected value in the range

Annotations
@Override