diff options
Diffstat (limited to 'mcs/class/Mono.Security.Win32/Mono.Security.Cryptography/CapiRandomNumberGenerator.cs')
-rw-r--r-- | mcs/class/Mono.Security.Win32/Mono.Security.Cryptography/CapiRandomNumberGenerator.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mcs/class/Mono.Security.Win32/Mono.Security.Cryptography/CapiRandomNumberGenerator.cs b/mcs/class/Mono.Security.Win32/Mono.Security.Cryptography/CapiRandomNumberGenerator.cs new file mode 100644 index 00000000000..514efefd91e --- /dev/null +++ b/mcs/class/Mono.Security.Win32/Mono.Security.Cryptography/CapiRandomNumberGenerator.cs @@ -0,0 +1,28 @@ +// +// Mono.Security.Cryptography.CapiRandomNumberGenerator +// +// Authors: +// Sebastien Pouliot (spouliot@motus.com) +// +// Copyright (C) 2003 Motus Technologies Inc. (http://www.motus.com) +// + +using System; +using System.Security.Cryptography; + +namespace Mono.Security.Cryptography { + +class CapiRandomNumberGenerator : CapiContext { + + public CapiRandomNumberGenerator () : base () {} + + public CapiRandomNumberGenerator (CspParameters cspParams) : base (cspParams) {} + + public void GenRandom (byte[] data) + { + uint l = (uint) data.Length; + lastResult = CryptoAPI.CryptGenRandom (providerHandle, l, data); + } +} + +} |