AuthenticatedSafe.cs 959 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs
  5. {
  6. public class AuthenticatedSafe
  7. : Asn1Encodable
  8. {
  9. private readonly ContentInfo[] info;
  10. public AuthenticatedSafe(
  11. Asn1Sequence seq)
  12. {
  13. info = new ContentInfo[seq.Count];
  14. for (int i = 0; i != info.Length; i++)
  15. {
  16. info[i] = ContentInfo.GetInstance(seq[i]);
  17. }
  18. }
  19. public AuthenticatedSafe(
  20. ContentInfo[] info)
  21. {
  22. this.info = (ContentInfo[]) info.Clone();
  23. }
  24. public ContentInfo[] GetContentInfo()
  25. {
  26. return (ContentInfo[]) info.Clone();
  27. }
  28. public override Asn1Object ToAsn1Object()
  29. {
  30. return new BerSequence(info);
  31. }
  32. }
  33. }
  34. #pragma warning restore
  35. #endif