CrlAnnContent.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
  6. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
  7. {
  8. public class CrlAnnContent
  9. : Asn1Encodable
  10. {
  11. private readonly Asn1Sequence content;
  12. private CrlAnnContent(Asn1Sequence seq)
  13. {
  14. content = seq;
  15. }
  16. public static CrlAnnContent GetInstance(object obj)
  17. {
  18. if (obj is CrlAnnContent)
  19. return (CrlAnnContent)obj;
  20. if (obj is Asn1Sequence)
  21. return new CrlAnnContent((Asn1Sequence)obj);
  22. throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
  23. }
  24. public virtual CertificateList[] ToCertificateListArray()
  25. {
  26. CertificateList[] result = new CertificateList[content.Count];
  27. for (int i = 0; i != result.Length; ++ i)
  28. {
  29. result[i] = CertificateList.GetInstance(content[i]);
  30. }
  31. return result;
  32. }
  33. /**
  34. * <pre>
  35. * CrlAnnContent ::= SEQUENCE OF CertificateList
  36. * </pre>
  37. * @return a basic ASN.1 object representation.
  38. */
  39. public override Asn1Object ToAsn1Object()
  40. {
  41. return content;
  42. }
  43. }
  44. }
  45. #pragma warning restore
  46. #endif