AlertLevel.cs 844 B

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls
  5. {
  6. /// <summary>RFC 5246 7.2</summary>
  7. public abstract class AlertLevel
  8. {
  9. public const short warning = 1;
  10. public const short fatal = 2;
  11. public static string GetName(short alertDescription)
  12. {
  13. switch (alertDescription)
  14. {
  15. case warning:
  16. return "warning";
  17. case fatal:
  18. return "fatal";
  19. default:
  20. return "UNKNOWN";
  21. }
  22. }
  23. public static string GetText(short alertDescription)
  24. {
  25. return GetName(alertDescription) + "(" + alertDescription + ")";
  26. }
  27. }
  28. }
  29. #pragma warning restore
  30. #endif