RandomNumberGenerator.cs 741 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // System.Security.Cryptography.RandomNumberGenerator
  3. //
  4. // author:
  5. // Duco Fijma ([email protected])
  6. //
  7. // (C) 2002 Duco Fijma
  8. //
  9. using System.Globalization;
  10. namespace System.Security.Cryptography {
  11. public abstract class RandomNumberGenerator {
  12. public RandomNumberGenerator () {}
  13. public static RandomNumberGenerator Create ()
  14. {
  15. // create the default random number generator
  16. return Create ("System.Security.Cryptography.RandomNumberGenerator");
  17. }
  18. public static RandomNumberGenerator Create (string rngName)
  19. {
  20. return (RandomNumberGenerator) (CryptoConfig.CreateFromName (rngName));
  21. }
  22. public abstract void GetBytes (byte[] data);
  23. public abstract void GetNonZeroBytes (byte[] data);
  24. }
  25. }