This project has moved. For the latest updates, please go here.

Security.Cryptography.RNGCng


The RNGCng class provides a managed wrapper around the CNG random number generator. It provides the same interface as the other cryptographic random number generator implementation shipped with the .NET Framework, System.Security.Cryptography.RNGCryptoServiceProvider .

RNGCng uses the BCrypt layer of CNG to do its work, and requires Windows Vista and the .NET Framework 3.5.

APIs

.ctor()

Creates a new instance of a random number generator object using the Microsoft Primitive Algorithm Provider.

.ctor(System.Security.Cryptography.CngProvider algorithmProvider)

Creates a new instance of a random number generator object using the specified algorithm provider.

Parameters:
algorithmProvider algorithm provider to use for random number generation


Exceptions:
System.ArgumentNullException if algorithmProvider is null


void GetBytes(System.Byte[] data)


GetBytes fills the input data array with randomly generated bytes. The input values of the array are ignored.

This method is thread safe.


Parameters:
data array to fill with randomly generated bytes


Exceptions:
System.ArgumentNullException if data is null


void GetNonZeroBytes(System.Byte[] data)

GetNonZeroBytes is not implemented by the RNGCng class.

Parameters:
data


Exceptions:
System.NotImplementedException GetNonZeroBytes is not implemented



Last edited Jun 4, 2009 at 1:47 AM by shawnfa, version 4

Comments

No comments yet.