CertConfirmContent.cs 1.2 KB

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