using System;
using System.Collections;
namespace System.Security.Cryptography.X509Certificates
{
/// Defines a collection that stores objects.
// Token: 0x0200028B RID: 651
[Serializable]
public class X509CertificateCollection : CollectionBase
{
/// Initializes a new instance of the class.
// Token: 0x060017ED RID: 6125 RVA: 0x00050CB0 File Offset: 0x0004EEB0
public X509CertificateCollection()
{
}
/// Initializes a new instance of the class from an array of objects.
/// The array of objects with which to initialize the new object.
// Token: 0x060017EE RID: 6126 RVA: 0x00050CB8 File Offset: 0x0004EEB8
public X509CertificateCollection(X509Certificate[] value)
{
this.AddRange(value);
}
/// Initializes a new instance of the class from another .
/// The with which to initialize the new object.
// Token: 0x060017EF RID: 6127 RVA: 0x00050CC8 File Offset: 0x0004EEC8
public X509CertificateCollection(X509CertificateCollection value)
{
this.AddRange(value);
}
/// Gets or sets the entry at the specified index of the current .
/// The at the specified index of the current .
/// The zero-based index of the entry to locate in the current .
/// The parameter is outside the valid range of indexes for the collection.
// Token: 0x1700078A RID: 1930
public X509Certificate this[int index]
{
get
{
return (X509Certificate)base.InnerList[index];
}
set
{
base.InnerList[index] = value;
}
}
/// Adds an with the specified value to the current .
/// The index into the current at which the new was inserted.
/// The to add to the current .
// Token: 0x060017F2 RID: 6130 RVA: 0x00050CFC File Offset: 0x0004EEFC
public int Add(X509Certificate value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
return base.InnerList.Add(value);
}
/// Copies the elements of an array of type to the end of the current .
/// The array of type containing the objects to add to the current .
/// The parameter is null.
// Token: 0x060017F3 RID: 6131 RVA: 0x00050D1C File Offset: 0x0004EF1C
public void AddRange(X509Certificate[] value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
for (int i = 0; i < value.Length; i++)
{
base.InnerList.Add(value[i]);
}
}
/// Copies the elements of the specified to the end of the current .
/// The containing the objects to add to the collection.
/// The parameter is null.
// Token: 0x060017F4 RID: 6132 RVA: 0x00050D60 File Offset: 0x0004EF60
public void AddRange(X509CertificateCollection value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
for (int i = 0; i < value.InnerList.Count; i++)
{
base.InnerList.Add(value[i]);
}
}
/// Gets a value indicating whether the current contains the specified .
/// true if the is contained in this collection; otherwise, false.
/// The to locate.
// Token: 0x060017F5 RID: 6133 RVA: 0x00050DB0 File Offset: 0x0004EFB0
public bool Contains(X509Certificate value)
{
if (value == null)
{
return false;
}
byte[] certHash = value.GetCertHash();
for (int i = 0; i < base.InnerList.Count; i++)
{
X509Certificate x509Certificate = (X509Certificate)base.InnerList[i];
if (this.Compare(x509Certificate.GetCertHash(), certHash))
{
return true;
}
}
return false;
}
/// Copies the values in the current to a one-dimensional instance at the specified index.
/// The one-dimensional that is the destination of the values copied from .
/// The index into to begin copying.
/// The parameter is multidimensional.-or- The number of elements in the is greater than the available space between and the end of .
/// The parameter is null.
/// The parameter is less than the parameter's lower bound.
// Token: 0x060017F6 RID: 6134 RVA: 0x00050E10 File Offset: 0x0004F010
public void CopyTo(X509Certificate[] array, int index)
{
base.InnerList.CopyTo(array, index);
}
/// Returns an enumerator that can iterate through the .
/// An enumerator of the subelements of you can use to iterate through the collection.
// Token: 0x060017F7 RID: 6135 RVA: 0x00050E20 File Offset: 0x0004F020
public new X509CertificateCollection.X509CertificateEnumerator GetEnumerator()
{
return new X509CertificateCollection.X509CertificateEnumerator(this);
}
/// Builds a hash value based on all values contained in the current .
/// A hash value based on all values contained in the current .
// Token: 0x060017F8 RID: 6136 RVA: 0x00050E28 File Offset: 0x0004F028
public override int GetHashCode()
{
return base.InnerList.GetHashCode();
}
/// Returns the index of the specified in the current .
/// The index of the specified by the parameter in the , if found; otherwise, -1.
/// The to locate.
// Token: 0x060017F9 RID: 6137 RVA: 0x00050E38 File Offset: 0x0004F038
public int IndexOf(X509Certificate value)
{
return base.InnerList.IndexOf(value);
}
/// Inserts a into the current at the specified index.
/// The zero-based index where should be inserted.
/// The to insert.
// Token: 0x060017FA RID: 6138 RVA: 0x00050E48 File Offset: 0x0004F048
public void Insert(int index, X509Certificate value)
{
base.InnerList.Insert(index, value);
}
/// Removes a specific from the current .
/// The to remove from the current .
/// The specified by the parameter is not found in the current .
// Token: 0x060017FB RID: 6139 RVA: 0x00050E58 File Offset: 0x0004F058
public void Remove(X509Certificate value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
if (this.IndexOf(value) == -1)
{
throw new ArgumentException("value", global::Locale.GetText("Not part of the collection."));
}
base.InnerList.Remove(value);
}
// Token: 0x060017FC RID: 6140 RVA: 0x00050EA4 File Offset: 0x0004F0A4
private bool Compare(byte[] array1, byte[] array2)
{
if (array1 == null && array2 == null)
{
return true;
}
if (array1 == null || array2 == null)
{
return false;
}
if (array1.Length != array2.Length)
{
return false;
}
for (int i = 0; i < array1.Length; i++)
{
if (array1[i] != array2[i])
{
return false;
}
}
return true;
}
/// Enumerates the objects in an .
// Token: 0x0200028C RID: 652
public class X509CertificateEnumerator : IEnumerator
{
/// Initializes a new instance of the class for the specified .
/// The to enumerate.
// Token: 0x060017FD RID: 6141 RVA: 0x00050EFC File Offset: 0x0004F0FC
public X509CertificateEnumerator(X509CertificateCollection mappings)
{
this.enumerator = ((IEnumerable)mappings).GetEnumerator();
}
/// For a description of this member, see .
/// The current X.509 certificate object in the object.
/// The enumerator is positioned before the first element of the collection or after the last element.
// Token: 0x1700078B RID: 1931
// (get) Token: 0x060017FE RID: 6142 RVA: 0x00050F10 File Offset: 0x0004F110
object IEnumerator.Current
{
get
{
return this.enumerator.Current;
}
}
/// For a description of this member, see .
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// The collection was modified after the enumerator was instantiated.
// Token: 0x060017FF RID: 6143 RVA: 0x00050F20 File Offset: 0x0004F120
bool IEnumerator.MoveNext()
{
return this.enumerator.MoveNext();
}
/// For a description of this member, see .
/// The collection was modified after the enumerator was instantiated.
// Token: 0x06001800 RID: 6144 RVA: 0x00050F30 File Offset: 0x0004F130
void IEnumerator.Reset()
{
this.enumerator.Reset();
}
/// Gets the current in the .
/// The current in the .
/// The enumerator is positioned before the first element of the collection or after the last element.
// Token: 0x1700078C RID: 1932
// (get) Token: 0x06001801 RID: 6145 RVA: 0x00050F40 File Offset: 0x0004F140
public X509Certificate Current
{
get
{
return (X509Certificate)this.enumerator.Current;
}
}
/// Advances the enumerator to the next element of the collection.
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// The collection was modified after the enumerator was instantiated.
// Token: 0x06001802 RID: 6146 RVA: 0x00050F54 File Offset: 0x0004F154
public bool MoveNext()
{
return this.enumerator.MoveNext();
}
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// The collection is modified after the enumerator is instantiated.
// Token: 0x06001803 RID: 6147 RVA: 0x00050F64 File Offset: 0x0004F164
public void Reset()
{
this.enumerator.Reset();
}
// Token: 0x04001306 RID: 4870
private IEnumerator enumerator;
}
}
}