RandomNumberGenerator Class
TOC
Collapse the table of content
Expand the table of content

RandomNumberGenerator Class

 

Represents the abstract class from which all implementations of cryptographic random number generators derive.

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Security.Cryptography.RandomNumberGenerator
    System.Security.Cryptography.RNGCryptoServiceProvider

[ComVisibleAttribute(true)]
public abstract class RandomNumberGenerator : IDisposable

NameDescription
System_CAPS_protmethodRandomNumberGenerator()

Initializes a new instance of RandomNumberGenerator.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticCreate()

When overridden in a derived class, creates an instance of the default implementation of a cryptographic random number generator that can be used to generate random data.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String)

When overridden in a derived class, creates an instance of the specified implementation of a cryptographic random number generator.

System_CAPS_pubmethodDispose()

When overridden in a derived class, releases all resources used by the current instance of the RandomNumberGenerator class.

System_CAPS_protmethodDispose(Boolean)

When overridden in a derived class, releases the unmanaged resources used by the RandomNumberGenerator and optionally releases the managed resources.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetBytes(Byte[])

When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of values.

System_CAPS_pubmethodGetBytes(Byte[], Int32, Int32)

Fills the specified byte array with a cryptographically strong random sequence of values.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetNonZeroBytes(Byte[])

When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of nonzero values.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

Cryptographic random number generators create cryptographically strong random values.

Application code does not directly use this class. This abstract class is provided as the base class for all cryptographic random number generators.

For an implementation of a cryptographic random number generator, use the derived class RNGCryptoServiceProvider.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft