Revocable.cs 994 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Bcpg.Sig
  5. {
  6. /**
  7. * packet giving whether or not is revocable.
  8. */
  9. public class Revocable
  10. : SignatureSubpacket
  11. {
  12. private static byte[] BooleanToByteArray(bool value)
  13. {
  14. return new byte[1]{ Convert.ToByte(value) };
  15. }
  16. public Revocable(
  17. bool critical,
  18. bool isLongLength,
  19. byte[] data)
  20. : base(SignatureSubpacketTag.Revocable, critical, isLongLength, data)
  21. {
  22. }
  23. public Revocable(
  24. bool critical,
  25. bool isRevocable)
  26. : base(SignatureSubpacketTag.Revocable, critical, false, BooleanToByteArray(isRevocable))
  27. {
  28. }
  29. public bool IsRevocable()
  30. {
  31. return data[0] != 0;
  32. }
  33. }
  34. }
  35. #pragma warning restore
  36. #endif