AlertLevel.cs 850 B

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