X509ChainElementCollection.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // X509ChainElementCollection.cs - System.Security.Cryptography.X509Certificates.X509ChainElementCollection
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. #if NET_1_2
  10. using System;
  11. using System.Collections;
  12. namespace System.Security.Cryptography.X509Certificates {
  13. // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
  14. public sealed class X509ChainElementCollection : ICollection, IEnumerable {
  15. private ArrayList _list;
  16. // constructors
  17. // only accessible from X509Chain
  18. internal X509ChainElementCollection ()
  19. {
  20. _list = new ArrayList ();
  21. }
  22. // properties
  23. public int Count {
  24. get { return _list.Count; }
  25. }
  26. public bool IsSynchronized {
  27. get { return _list.IsSynchronized; }
  28. }
  29. public X509ChainElement this [int index] {
  30. get { return (X509ChainElement) _list [index]; }
  31. }
  32. public object SyncRoot {
  33. get { return _list.SyncRoot; }
  34. }
  35. // methods
  36. public void CopyTo (X509ChainElement[] array, int index)
  37. {
  38. _list.CopyTo ((Array)array, index);
  39. }
  40. void ICollection.CopyTo (Array array, int index)
  41. {
  42. _list.CopyTo (array, index);
  43. }
  44. public X509ChainElementEnumerator GetEnumerator ()
  45. {
  46. return new X509ChainElementEnumerator (_list);
  47. }
  48. IEnumerator IEnumerable.GetEnumerator ()
  49. {
  50. return new X509ChainElementEnumerator (_list);
  51. }
  52. }
  53. }
  54. #endif