mscorlib(4.0.0.0) API with additions
X509CertificateCollection.cs
1 using System.Collections;
2 
4 {
8  {
11  {
12  private IEnumerator baseEnumerator;
13 
14  private IEnumerable temp;
15 
19  public X509Certificate Current => (X509Certificate)baseEnumerator.Current;
20 
24  object IEnumerator.Current
25  {
26  get
27  {
28  return baseEnumerator.Current;
29  }
30  }
31 
35  {
36  temp = mappings;
37  baseEnumerator = temp.GetEnumerator();
38  }
39 
44  public bool MoveNext()
45  {
46  return baseEnumerator.MoveNext();
47  }
48 
53  bool IEnumerator.MoveNext()
54  {
55  return baseEnumerator.MoveNext();
56  }
57 
60  public void Reset()
61  {
62  baseEnumerator.Reset();
63  }
64 
67  void IEnumerator.Reset()
68  {
69  baseEnumerator.Reset();
70  }
71  }
72 
77  public X509Certificate this[int index]
78  {
79  get
80  {
81  return (X509Certificate)base.List[index];
82  }
83  set
84  {
85  base.List[index] = value;
86  }
87  }
88 
91  {
92  }
93 
97  {
98  AddRange(value);
99  }
100 
104  {
105  AddRange(value);
106  }
107 
111  public int Add(X509Certificate value)
112  {
113  return base.List.Add(value);
114  }
115 
119  public void AddRange(X509Certificate[] value)
120  {
121  if (value == null)
122  {
123  throw new ArgumentNullException("value");
124  }
125  for (int i = 0; i < value.Length; i++)
126  {
127  Add(value[i]);
128  }
129  }
130 
135  {
136  if (value == null)
137  {
138  throw new ArgumentNullException("value");
139  }
140  for (int i = 0; i < value.Count; i++)
141  {
142  Add(value[i]);
143  }
144  }
145 
150  public bool Contains(X509Certificate value)
151  {
152  foreach (X509Certificate item in base.List)
153  {
154  if (item.Equals(value))
155  {
156  return true;
157  }
158  }
159  return false;
160  }
161 
168  public void CopyTo(X509Certificate[] array, int index)
169  {
170  base.List.CopyTo(array, index);
171  }
172 
176  public int IndexOf(X509Certificate value)
177  {
178  return base.List.IndexOf(value);
179  }
180 
184  public void Insert(int index, X509Certificate value)
185  {
186  base.List.Insert(index, value);
187  }
188 
192  {
193  return new X509CertificateEnumerator(this);
194  }
195 
199  public void Remove(X509Certificate value)
200  {
201  base.List.Remove(value);
202  }
203 
206  public override int GetHashCode()
207  {
208  int num = 0;
209  X509CertificateEnumerator x509CertificateEnumerator = GetEnumerator();
210  try
211  {
212  while (x509CertificateEnumerator.MoveNext())
213  {
214  X509Certificate current = x509CertificateEnumerator.Current;
215  num += current.GetHashCode();
216  }
217  return num;
218  }
219  finally
220  {
221  IDisposable disposable = x509CertificateEnumerator as IDisposable;
222  if (disposable != null)
223  {
224  disposable.Dispose();
225  }
226  }
227  }
228  }
229 }
X509CertificateEnumerator(X509CertificateCollection mappings)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
X509CertificateCollection()
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
void Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
bool MoveNext()
Advances the enumerator to the next element of the collection.
Provides the abstract base class for a strongly typed collection.
X509Certificate Current
Gets the current T:System.Security.Cryptography.X509Certificates.X509Certificate in the T:System....
Defines a collection that stores T:System.Security.Cryptography.X509Certificates.X509Certificate obje...
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
Definition: IDisposable.cs:8
void AddRange(X509Certificate[] value)
Copies the elements of an array of type T:System.Security.Cryptography.X509Certificates....
Definition: __Canon.cs:3
int Add(X509Certificate value)
Adds an T:System.Security.Cryptography.X509Certificates.X509Certificate with the specified value to t...
Enumerates the T:System.Security.Cryptography.X509Certificates.X509Certificate objects in an T:System...
bool Contains(X509Certificate value)
Gets a value indicating whether the current T:System.Security.Cryptography.X509Certificates....
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
Definition: IEnumerable.cs:9
void CopyTo(X509Certificate[] array, int index)
Copies the T:System.Security.Cryptography.X509Certificates.X509Certificate values in the current T:Sy...
object Current
Gets the element in the collection at the current position of the enumerator.
Definition: IEnumerator.cs:15
void Remove(X509Certificate value)
Removes a specific T:System.Security.Cryptography.X509Certificates.X509Certificate from the current T...
The Add key (the addition key on the numeric keypad).
X509CertificateCollection(X509CertificateCollection value)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
void Insert(int index, X509Certificate value)
Inserts a T:System.Security.Cryptography.X509Certificates.X509Certificate into the current T:System....
void Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
override int GetHashCode()
Returns the hash code for the X.509v3 certificate as an integer.
override int GetHashCode()
Builds a hash value based on all values contained in the current T:System.Security....
int IndexOf(X509Certificate value)
Returns the index of the specified T:System.Security.Cryptography.X509Certificates....
Specifies that the class can be serialized.
void AddRange(X509CertificateCollection value)
Copies the elements of the specified T:System.Security.Cryptography.X509Certificates....
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
X509CertificateCollection(X509Certificate[] value)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
Supports a simple iteration over a non-generic collection.
Definition: IEnumerator.cs:9
Provides methods that help you use X.509 v.3 certificates.
new X509CertificateEnumerator GetEnumerator()
Returns an enumerator that can iterate through the T:System.Security.Cryptography....