Files
2026-06-04 11:42:34 +02:00

168 lines
6.9 KiB
C#

using System;
using System.Collections;
namespace System.Security.Cryptography
{
/// <summary>Represents a collection of <see cref="T:System.Security.Cryptography.Oid" /> objects. This class cannot be inherited.</summary>
// Token: 0x020002A8 RID: 680
public sealed class OidCollection : ICollection, IEnumerable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.OidCollection" /> class.</summary>
// Token: 0x060018D3 RID: 6355 RVA: 0x00055310 File Offset: 0x00053510
public OidCollection()
{
this._list = new ArrayList();
}
/// <summary>Copies the <see cref="T:System.Security.Cryptography.OidCollection" /> object into an array.</summary>
/// <param name="array">The array to copy the <see cref="T:System.Security.Cryptography.OidCollection" /> object to.</param>
/// <param name="index">The location where the copy operation starts.</param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> cannot be a multidimensional array.-or-The length of <paramref name="array" /> is an invalid offset length.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The value of <paramref name="index" /> is out range.</exception>
// Token: 0x060018D4 RID: 6356 RVA: 0x00055324 File Offset: 0x00053524
void ICollection.CopyTo(Array array, int index)
{
this._list.CopyTo(array, index);
}
/// <summary>Returns an <see cref="T:System.Security.Cryptography.OidEnumerator" /> object that can be used to navigate the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</summary>
/// <returns>An <see cref="T:System.Security.Cryptography.OidEnumerator" /> object that can be used to navigate the collection.</returns>
// Token: 0x060018D5 RID: 6357 RVA: 0x00055334 File Offset: 0x00053534
IEnumerator IEnumerable.GetEnumerator()
{
return new OidEnumerator(this);
}
/// <summary>Gets the number of <see cref="T:System.Security.Cryptography.Oid" /> objects in a collection. </summary>
/// <returns>The number of <see cref="T:System.Security.Cryptography.Oid" /> objects in a collection.</returns>
// Token: 0x170007C5 RID: 1989
// (get) Token: 0x060018D6 RID: 6358 RVA: 0x0005533C File Offset: 0x0005353C
public int Count
{
get
{
return this._list.Count;
}
}
/// <summary>Gets a value that indicates whether access to the <see cref="T:System.Security.Cryptography.OidCollection" /> object is thread safe.</summary>
/// <returns>false in all cases.</returns>
// Token: 0x170007C6 RID: 1990
// (get) Token: 0x060018D7 RID: 6359 RVA: 0x0005534C File Offset: 0x0005354C
public bool IsSynchronized
{
get
{
return this._list.IsSynchronized;
}
}
/// <summary>Gets an <see cref="T:System.Security.Cryptography.Oid" /> object from the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</summary>
/// <returns>An <see cref="T:System.Security.Cryptography.Oid" /> object.</returns>
/// <param name="index">The location of the <see cref="T:System.Security.Cryptography.Oid" /> object in the collection.</param>
// Token: 0x170007C7 RID: 1991
public Oid this[int index]
{
get
{
return (Oid)this._list[index];
}
}
/// <summary>Gets the first <see cref="T:System.Security.Cryptography.Oid" /> object that contains a value of the <see cref="P:System.Security.Cryptography.Oid.Value" /> property or a value of the <see cref="P:System.Security.Cryptography.Oid.FriendlyName" /> property that matches the specified string value from the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</summary>
/// <returns>An <see cref="T:System.Security.Cryptography.Oid" /> object.</returns>
/// <param name="oid">A string that represents a <see cref="P:System.Security.Cryptography.Oid.Value" /> property or a <see cref="P:System.Security.Cryptography.Oid.FriendlyName" /> property.</param>
// Token: 0x170007C8 RID: 1992
public Oid this[string oid]
{
get
{
foreach (object obj in this._list)
{
Oid oid2 = (Oid)obj;
if (oid2.Value == oid)
{
return oid2;
}
}
return null;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</returns>
// Token: 0x170007C9 RID: 1993
// (get) Token: 0x060018DA RID: 6362 RVA: 0x000553F4 File Offset: 0x000535F4
public object SyncRoot
{
get
{
return this._list.SyncRoot;
}
}
/// <summary>Adds an <see cref="T:System.Security.Cryptography.Oid" /> object to the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</summary>
/// <returns>The index of the added <see cref="T:System.Security.Cryptography.Oid" /> object.</returns>
/// <param name="oid">The <see cref="T:System.Security.Cryptography.Oid" /> object to add to the collection.</param>
// Token: 0x060018DB RID: 6363 RVA: 0x00055404 File Offset: 0x00053604
public int Add(Oid oid)
{
return (!this._readOnly) ? this._list.Add(oid) : 0;
}
/// <summary>Copies the <see cref="T:System.Security.Cryptography.OidCollection" /> object into an array.</summary>
/// <param name="array">The array to copy the <see cref="T:System.Security.Cryptography.OidCollection" /> object into.</param>
/// <param name="index">The location where the copy operation starts.</param>
// Token: 0x060018DC RID: 6364 RVA: 0x00055424 File Offset: 0x00053624
public void CopyTo(Oid[] array, int index)
{
this._list.CopyTo(array, index);
}
/// <summary>Returns an <see cref="T:System.Security.Cryptography.OidEnumerator" /> object that can be used to navigate the <see cref="T:System.Security.Cryptography.OidCollection" /> object.</summary>
/// <returns>An <see cref="T:System.Security.Cryptography.OidEnumerator" /> object.</returns>
// Token: 0x060018DD RID: 6365 RVA: 0x00055434 File Offset: 0x00053634
public OidEnumerator GetEnumerator()
{
return new OidEnumerator(this);
}
// Token: 0x170007CA RID: 1994
// (get) Token: 0x060018DE RID: 6366 RVA: 0x0005543C File Offset: 0x0005363C
// (set) Token: 0x060018DF RID: 6367 RVA: 0x00055444 File Offset: 0x00053644
internal bool ReadOnly
{
get
{
return this._readOnly;
}
set
{
this._readOnly = value;
}
}
// Token: 0x060018E0 RID: 6368 RVA: 0x00055450 File Offset: 0x00053650
internal OidCollection ReadOnlyCopy()
{
OidCollection oidCollection = new OidCollection();
foreach (object obj in this._list)
{
Oid oid = (Oid)obj;
oidCollection.Add(oid);
}
oidCollection._readOnly = true;
return oidCollection;
}
// Token: 0x040013BD RID: 5053
private ArrayList _list;
// Token: 0x040013BE RID: 5054
private bool _readOnly;
}
}