SecurityKeyEntropyMode.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.Security
  5. {
  6. using System.ComponentModel;
  7. public enum SecurityKeyEntropyMode
  8. {
  9. ClientEntropy,
  10. ServerEntropy,
  11. CombinedEntropy
  12. }
  13. sealed class SecurityKeyEntropyModeHelper
  14. {
  15. internal static bool IsDefined(SecurityKeyEntropyMode value)
  16. {
  17. return (value == SecurityKeyEntropyMode.ClientEntropy
  18. || value == SecurityKeyEntropyMode.ServerEntropy
  19. || value == SecurityKeyEntropyMode.CombinedEntropy);
  20. }
  21. internal static void Validate(SecurityKeyEntropyMode value)
  22. {
  23. if (!IsDefined(value))
  24. {
  25. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value,
  26. typeof(SecurityKeyEntropyMode)));
  27. }
  28. }
  29. }
  30. }