2 // X509CertificateCollection.cs: Handles certificate collection.
3 // based on: mcs\class\System\System.Security.Cryptography.X509Certificates\X509CertificateCollection.cs
6 // Lawrence Pit (loz@cable.a2000.nl) -- original work
7 // Sebastien Pouliot (spouliot@motus.com) -- all modifications and bugs ;-)
11 using System.Collections;
13 namespace Microsoft.Web.Services.Security.X509 {
15 public class X509CertificateCollection : CollectionBase {
17 public X509CertificateCollection () {}
19 public X509Certificate this [int index] {
21 // required for exception ?
22 if ((index < 0) || (index > InnerList.Count))
23 throw new ArgumentOutOfRangeException ("index");
24 return (X509Certificate) InnerList [index];
28 public int Add (X509Certificate certificate)
30 if (certificate == null)
31 throw new ArgumentNullException ("value");
33 return InnerList.Add (certificate);
36 public bool Contains (X509Certificate certificate)
38 return InnerList.Contains (certificate);
41 public void CopyTo (Array array, int index)
43 InnerList.CopyTo (array, index);
46 public int IndexOf (X509Certificate certificate)
48 return InnerList.IndexOf (certificate);
51 public void Insert (int index, X509Certificate certificate)
53 InnerList.Insert (index, certificate);
56 public void Remove (X509Certificate certificate)
58 InnerList.Remove (certificate);