ReasonFlags.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509
  4. {
  5. /**
  6. * The ReasonFlags object.
  7. * <pre>
  8. * ReasonFlags ::= BIT STRING {
  9. * unused(0),
  10. * keyCompromise(1),
  11. * cACompromise(2),
  12. * affiliationChanged(3),
  13. * superseded(4),
  14. * cessationOfOperation(5),
  15. * certficateHold(6)
  16. * }
  17. * </pre>
  18. */
  19. public class ReasonFlags
  20. : DerBitString
  21. {
  22. public const int Unused = (1 << 7);
  23. public const int KeyCompromise = (1 << 6);
  24. public const int CACompromise = (1 << 5);
  25. public const int AffiliationChanged = (1 << 4);
  26. public const int Superseded = (1 << 3);
  27. public const int CessationOfOperation = (1 << 2);
  28. public const int CertificateHold = (1 << 1);
  29. public const int PrivilegeWithdrawn = (1 << 0);
  30. public const int AACompromise = (1 << 15);
  31. /**
  32. * @param reasons - the bitwise OR of the Key Reason flags giving the
  33. * allowed uses for the key.
  34. */
  35. public ReasonFlags(int reasons)
  36. : base(reasons)
  37. {
  38. }
  39. public ReasonFlags(
  40. DerBitString reasons)
  41. : base(reasons.GetBytes(), reasons.PadBits)
  42. {
  43. }
  44. }
  45. }
  46. #pragma warning restore
  47. #endif