MaxFragmentLength.cs 555 B

123456789101112131415161718192021222324
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Crypto.Tls
  4. {
  5. public abstract class MaxFragmentLength
  6. {
  7. /*
  8. * RFC 3546 3.2.
  9. */
  10. public const byte pow2_9 = 1;
  11. public const byte pow2_10 = 2;
  12. public const byte pow2_11 = 3;
  13. public const byte pow2_12 = 4;
  14. public static bool IsValid(byte maxFragmentLength)
  15. {
  16. return maxFragmentLength >= pow2_9 && maxFragmentLength <= pow2_12;
  17. }
  18. }
  19. }
  20. #endif