10 private SafeProvHandle m_safeProvHandle;
12 private bool m_ownsHandle;
36 [SecuritySafeCritical]
39 if (cspParams !=
null)
41 m_safeProvHandle = Utils.AcquireProvHandle(cspParams);
46 m_safeProvHandle = Utils.StaticProvHandle;
51 [SecuritySafeCritical]
52 protected override void Dispose(
bool disposing)
54 base.Dispose(disposing);
55 if (disposing && m_ownsHandle)
57 m_safeProvHandle.Dispose();
66 [SecuritySafeCritical]
73 GetBytes(m_safeProvHandle, data, data.Length);
81 [SecuritySafeCritical]
93 [SuppressUnmanagedCodeSecurity]
94 private static extern void GetBytes(SafeProvHandle hProv,
byte[] randomBytes,
int count);
98 [SuppressUnmanagedCodeSecurity]
99 private static extern void GetNonZeroBytes(SafeProvHandle hProv,
byte[] randomBytes,
int count);
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
RNGCryptoServiceProvider(string str)
Initializes a new instance of the T:System.Security.Cryptography.RNGCryptoServiceProvider class.
override void GetBytes(byte[] data)
Fills an array of bytes with a cryptographically strong sequence of random values.
RNGCryptoServiceProvider(byte[] rgb)
Initializes a new instance of the T:System.Security.Cryptography.RNGCryptoServiceProvider class.
Implements a cryptographic Random Number Generator (RNG) using the implementation provided by the cry...
override void Dispose(bool disposing)
When overridden in a derived class, releases the unmanaged resources used by the T:System....
Contains parameters that are passed to the cryptographic service provider (CSP) that performs cryptog...
RNGCryptoServiceProvider(CspParameters cspParams)
Initializes a new instance of the T:System.Security.Cryptography.RNGCryptoServiceProvider class with ...
CharSet
Dictates which character set marshaled strings should use.
override void GetNonZeroBytes(byte[] data)
Fills an array of bytes with a cryptographically strong sequence of random nonzero values.
Represents the abstract class from which all implementations of cryptographic random number generator...
RNGCryptoServiceProvider()
Initializes a new instance of the T:System.Security.Cryptography.RNGCryptoServiceProvider class.