Export (0) Print
Expand All

X509Certificate2Collection.Insert Method (Int32, X509Certificate2)

Inserts an object into the X509Certificate2Collection object at the specified index.

Namespace:  System.Security.Cryptography.X509Certificates
Assembly:  System (in System.dll)

public void Insert(
	int index,
	X509Certificate2 certificate
)

Parameters

index
Type: System.Int32

The zero-based index at which to insert certificate.

certificate
Type: System.Security.Cryptography.X509Certificates.X509Certificate2

The X509Certificate2 object to insert.

ExceptionCondition
ArgumentOutOfRangeException

index is less than zero.

-or-

index is greater than the Count property.

NotSupportedException

The collection is read-only.

-or-

The collection has a fixed size.

ArgumentNullException

certificate is null.

If the Count property already equals the capacity of the list, the capacity is doubled by automatically reallocating the internal array before the new element is inserted.

If index is equal to Count, certificate is added to the end of the collection.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft