Pkcs9AttributeCollection.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // Pkcs9AttributeCollection.cs - System.Security.Cryptography.Pkcs.Pkcs9AttributeCollection
  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.Pkcs {
  13. public class Pkcs9AttributeCollection : ICollection {
  14. private ArrayList _list;
  15. public Pkcs9AttributeCollection ()
  16. {
  17. _list = new ArrayList ();
  18. }
  19. // properties
  20. public int Count {
  21. get { return _list.Count; }
  22. }
  23. public bool IsSynchronized {
  24. get { return _list.IsSynchronized; }
  25. }
  26. public Pkcs9Attribute this [int index] {
  27. get { return (Pkcs9Attribute) _list [index]; }
  28. }
  29. public object SyncRoot {
  30. get { return _list.SyncRoot; }
  31. }
  32. // methods
  33. public int Add (Pkcs9Attribute attribute)
  34. {
  35. return _list.Add (attribute);
  36. }
  37. public void CopyTo (Array array, int index)
  38. {
  39. _list.CopyTo (array, index);
  40. }
  41. public void CopyTo (Pkcs9Attribute[] array, int index)
  42. {
  43. _list.CopyTo (array, index);
  44. }
  45. public Pkcs9AttributeEnumerator GetEnumerator ()
  46. {
  47. return new Pkcs9AttributeEnumerator (_list);
  48. }
  49. IEnumerator IEnumerable.GetEnumerator ()
  50. {
  51. return new Pkcs9AttributeEnumerator (_list);
  52. }
  53. public void Remove (Pkcs9Attribute attribute)
  54. {
  55. _list.Remove (attribute);
  56. }
  57. }
  58. }
  59. #endif