OriginatorInformation.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.Cms;
  5. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
  6. using Best.HTTP.SecureProtocol.Org.BouncyCastle.X509;
  7. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Cms
  8. {
  9. public class OriginatorInformation
  10. {
  11. private readonly OriginatorInfo originatorInfo;
  12. internal OriginatorInformation(OriginatorInfo originatorInfo)
  13. {
  14. this.originatorInfo = originatorInfo;
  15. }
  16. /**
  17. * Return the certificates stored in the underlying OriginatorInfo object.
  18. *
  19. * @return a Store of X509CertificateHolder objects.
  20. */
  21. public virtual IStore<X509Certificate> GetCertificates()
  22. {
  23. return CmsSignedHelper.Instance.GetCertificates(originatorInfo.Certificates);
  24. }
  25. /**
  26. * Return the CRLs stored in the underlying OriginatorInfo object.
  27. *
  28. * @return a Store of X509CRLHolder objects.
  29. */
  30. public virtual IStore<X509Crl> GetCrls()
  31. {
  32. return CmsSignedHelper.Instance.GetCrls(originatorInfo.Crls);
  33. }
  34. /**
  35. * Return the underlying ASN.1 object defining this SignerInformation object.
  36. *
  37. * @return a OriginatorInfo.
  38. */
  39. public virtual OriginatorInfo ToAsn1Structure()
  40. {
  41. return originatorInfo;
  42. }
  43. }
  44. }
  45. #pragma warning restore
  46. #endif