RespData.cs 1.3 KB

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