RSAOAEPKeyExchangeFormatter.Rng Property

Definition

Gets or sets the random number generator algorithm to use in the creation of the key exchange.

C#
public System.Security.Cryptography.RandomNumberGenerator? Rng { get; set; }
C#
public System.Security.Cryptography.RandomNumberGenerator Rng { get; set; }

Property Value

The instance of a random number generator algorithm to use.

Examples

The following code example demonstrates how to set the Rng property to a random number. This code example is part of a larger example provided for the RSAOAEPKeyExchangeFormatter class.

C#
RandomNumberGenerator ring = RandomNumberGenerator.Create(); 
rsaFormatter.Rng = ring;

Remarks

If this property is null, the default random number generator algorithm is used.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also