SignedCms.RemoveSignature Method

Definition

Removes the specified signature from the SignerInfos collection.

Overloads

RemoveSignature(Int32)

Removes the signature at the specified index of the SignerInfos collection.

RemoveSignature(SignerInfo)

The RemoveSignature(SignerInfo) method removes the signature for the specified SignerInfo object.

RemoveSignature(Int32)

Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs

Removes the signature at the specified index of the SignerInfos collection.

C#
public void RemoveSignature(int index);

Parameters

index
Int32

The zero-based index of the signature to remove.

Exceptions

A CMS/PKCS #7 message is not signed, and index is invalid.

index is less than zero.

-or-

index is greater than the signature count minus 1.

The signature could not be removed.

-or-

An internal cryptographic error occurred.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

RemoveSignature(SignerInfo)

Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs

The RemoveSignature(SignerInfo) method removes the signature for the specified SignerInfo object.

C#
public void RemoveSignature(System.Security.Cryptography.Pkcs.SignerInfo signerInfo);

Parameters

signerInfo
SignerInfo

A SignerInfo object that represents the countersignature being removed.

Exceptions

A null reference was passed to a method that does not accept it as a valid argument.

The value of an argument was outside the allowable range of values as defined by the called method.

A cryptographic operation could not be completed.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10