RecipientInfoCollection.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // RecipientInfoCollection.cs - System.Security.Cryptography.Pkcs.RecipientInfoCollection
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. #if NET_2_0
  10. using System;
  11. using System.Collections;
  12. namespace System.Security.Cryptography.Pkcs {
  13. public class RecipientInfoCollection : ICollection {
  14. private ArrayList _list;
  15. // only accessible from EnvelopedPkcs7.RecipientInfos
  16. internal RecipientInfoCollection ()
  17. {
  18. _list = new ArrayList ();
  19. }
  20. // properties
  21. public int Count {
  22. get { return _list.Count; }
  23. }
  24. public bool IsSynchronized {
  25. get { return _list.IsSynchronized; }
  26. }
  27. public RecipientInfo this [int index] {
  28. get { return (RecipientInfo) _list [index]; }
  29. }
  30. public object SyncRoot {
  31. get { return _list.SyncRoot; }
  32. }
  33. // methods
  34. internal int Add (RecipientInfo ri)
  35. {
  36. return _list.Add (ri);
  37. }
  38. public void CopyTo (Array array, int index)
  39. {
  40. _list.CopyTo (array, index);
  41. }
  42. public void CopyTo (RecipientInfo[] array, int index)
  43. {
  44. _list.CopyTo (array, index);
  45. }
  46. public RecipientInfoEnumerator GetEnumerator ()
  47. {
  48. return new RecipientInfoEnumerator (_list);
  49. }
  50. IEnumerator IEnumerable.GetEnumerator ()
  51. {
  52. return new RecipientInfoEnumerator (_list);
  53. }
  54. }
  55. }
  56. #endif