Table of Contents

Class CryptoApiRandomGenerator

Namespace
Org.BouncyCastle.Crypto.Prng
Assembly
BouncyCastle.Cryptography.dll

Uses RandomNumberGenerator.Create() to get randomness generator

public sealed class CryptoApiRandomGenerator : IRandomGenerator, IDisposable
Inheritance
CryptoApiRandomGenerator
Implements
Inherited Members

Constructors

CryptoApiRandomGenerator()

public CryptoApiRandomGenerator()

CryptoApiRandomGenerator(RandomNumberGenerator)

public CryptoApiRandomGenerator(RandomNumberGenerator randomNumberGenerator)

Parameters

randomNumberGenerator RandomNumberGenerator

Methods

AddSeedMaterial(byte[])

Add more seed material to the generator.

public void AddSeedMaterial(byte[] seed)

Parameters

seed byte[]

A byte array to be mixed into the generator's state.

AddSeedMaterial(long)

Add more seed material to the generator.

public void AddSeedMaterial(long seed)

Parameters

seed long

A long value to be mixed into the generator's state.

AddSeedMaterial(ReadOnlySpan<byte>)

public void AddSeedMaterial(ReadOnlySpan<byte> inSeed)

Parameters

inSeed ReadOnlySpan<byte>

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

NextBytes(byte[])

Fill byte array with random values.

public void NextBytes(byte[] bytes)

Parameters

bytes byte[]

Array to be filled.

NextBytes(byte[], int, int)

Fill byte array with random values.

public void NextBytes(byte[] bytes, int start, int len)

Parameters

bytes byte[]

Array to receive bytes.

start int

Index to start filling at.

len int

Length of segment to fill.

NextBytes(Span<byte>)

public void NextBytes(Span<byte> bytes)

Parameters

bytes Span<byte>