<PackageReference Include="System.Security.Cryptography.Pkcs" Version="11.0.0-preview.2.26159.112" />

System.Security.Cryptography.Pkcs.SignerInfo

public sealed class SignerInfo
The SignerInfo class represents a signer associated with a SignedCms object that represents a CMS/PKCS #7 message.
public X509Certificate2 Certificate { get; }

The Certificate property retrieves the signing certificate associated with the signer information.

The CounterSignerInfos property retrieves the set of counter signers associated with the signer information.

public Oid DigestAlgorithm { get; }

The DigestAlgorithm property retrieves the Oid object that represents the hash algorithm used in the computation of the signatures.

public Oid SignatureAlgorithm { get; }

Gets the identifier for the signature algorithm used by the current SignerInfo object.

The SignedAttributes property retrieves the CryptographicAttributeObjectCollection collection of signed attributes that is associated with the signer information. Signed attributes are signed along with the rest of the message content.

The SignerIdentifier property retrieves the certificate identifier of the signer associated with the signer information.

The UnsignedAttributes property retrieves the CryptographicAttributeObjectCollection collection of unsigned attributes that is associated with the SignerInfo content. Unsigned attributes can be modified without invalidating the signature.

public int Version { get; }

The Version property retrieves the signer information version.

public void AddUnsignedAttribute(AsnEncodedData unsignedAttribute)

Adds the specified attribute to the current document.

public void CheckHash()

The CheckHash method verifies the data integrity of the CMS/PKCS #7 message signer information. CheckHash is a specialized method used in specific security infrastructure applications in which the subject uses the HashOnly member of the SubjectIdentifierType enumeration when setting up a CmsSigner object. CheckHash does not authenticate the signer information because this method does not involve verifying a digital signature. For general-purpose checking of the integrity and authenticity of CMS/PKCS #7 message signer information and countersignatures, use the CheckSignature or CheckSignature methods.

public void CheckSignature(bool verifySignatureOnly)

The CheckSignature method verifies the digital signature of the message and, optionally, validates the certificate.

public void CheckSignature(X509Certificate2Collection extraStore, bool verifySignatureOnly)

The CheckSignature method verifies the digital signature of the message by using the specified collection of certificates and, optionally, validates the certificate.

The ComputeCounterSignature method prompts the user to select a signing certificate, creates a countersignature, and adds the signature to the CMS/PKCS #7 message. Countersignatures are restricted to one level.

public void ComputeCounterSignature(CmsSigner signer)

The ComputeCounterSignature method creates a countersignature by using the specified signer and adds the signature to the CMS/PKCS #7 message. Countersignatures are restricted to one level.

public byte[] GetSignature()

Retrieves the signature for the current SignerInfo object.

public void RemoveCounterSignature(int index)

The RemoveCounterSignature method removes the countersignature at the specified index of the CounterSignerInfos collection.

public void RemoveCounterSignature(SignerInfo counterSignerInfo)

The RemoveCounterSignature method removes the countersignature for the specified SignerInfo object.

public void RemoveUnsignedAttribute(AsnEncodedData unsignedAttribute)

Removes the specified attribute from the current document.