ReasonFlags.cs 1.4 KB

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