RespData.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.Collections;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
  6. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp;
  7. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
  8. using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
  9. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp
  10. {
  11. public class RespData
  12. : X509ExtensionBase
  13. {
  14. internal readonly ResponseData data;
  15. public RespData(
  16. ResponseData data)
  17. {
  18. this.data = data;
  19. }
  20. public int Version
  21. {
  22. get { return data.Version.IntValueExact + 1; }
  23. }
  24. public RespID GetResponderId()
  25. {
  26. return new RespID(data.ResponderID);
  27. }
  28. public DateTime ProducedAt
  29. {
  30. get { return data.ProducedAt.ToDateTime(); }
  31. }
  32. public SingleResp[] GetResponses()
  33. {
  34. Asn1Sequence s = data.Responses;
  35. SingleResp[] rs = new SingleResp[s.Count];
  36. for (int i = 0; i != rs.Length; i++)
  37. {
  38. rs[i] = new SingleResp(SingleResponse.GetInstance(s[i]));
  39. }
  40. return rs;
  41. }
  42. public X509Extensions ResponseExtensions
  43. {
  44. get { return data.ResponseExtensions; }
  45. }
  46. protected override X509Extensions GetX509Extensions()
  47. {
  48. return ResponseExtensions;
  49. }
  50. }
  51. }
  52. #pragma warning restore
  53. #endif