<PackageReference Include="BouncyCastle.Cryptography" Version="2.8.0-beta.349" />

Org.BouncyCastle.Cms.SignerInformation

public class SignerInformation
Represents an expanded CMS SignerInfo from a signed-data message. Obtain instances from GetSignerInfos, match signers with SignerID, then call Verify or Verify.

protected SignerInfo info

protected readonly Asn1Set signedAttributeSet

protected readonly Asn1Set unsignedAttributeSet

Gets the content type of the signed data, or null for a counter signature.

public string DigestAlgOid { get; }

Gets the digest algorithm OID. Use DigestAlgorithmID instead.

Gets the digest algorithm identifier from the underlying SignerInfo.

public Asn1Object DigestAlgParams { get; }

Gets the digest algorithm parameters, or null if absent. Use DigestAlgorithmID instead.

public string EncryptionAlgOid { get; }

Gets the signature algorithm OID. Use SignatureAlgorithm instead.

Gets the signature algorithm identifier. Use SignatureAlgorithm instead.

Gets the signature algorithm parameters, or null if absent. Use SignatureAlgorithm instead.

public bool IsCounterSignature { get; }

Gets a value indicating whether this signer information represents a counter signature.

Gets the signature algorithm identifier from the underlying SignerInfo.

Gets a table of signed attributes indexed by attribute OID.

public SignerID SignerID { get; }

Gets the identifier used to match this signer against certificates.

public SignerInfo SignerInfo { get; }

Gets the underlying ASN.1 SignerInfo structure.

Gets a table of unsigned attributes indexed by attribute OID.

public int Version { get; }

Gets the SignerInfo version number.

Initializes a new instance based on baseInfo for subclasses that override signed-attribute handling or signature calculation.

public static SignerInformation AddCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)

Returns a copy of signerInformation with counter signatures from counterSigners attached as an unsigned attribute.

public static SignerInformation ReplaceUnsignedAttributes(SignerInformation signerInformation, AttributeTable unsignedAttributes)

Returns a copy of signerInformation with unsigned attributes replaced by unsignedAttributes.

public byte[] GetContentDigest()

Returns the content digest calculated during the most recent successful verification.

Returns counter signatures attached to this signer as unsigned attributes, or an empty store if none are present.

public virtual byte[] GetEncodedSignedAttributes()

Returns the DER encoding of the signed attributes, or null if none are present.

public byte[] GetSignature()

Returns a copy of the encoded signature value.

Gets the underlying ASN.1 SignerInfo structure. Use SignerInfo instead.

public bool Verify(AsymmetricKeyParameter pubKey)

Verifies the signature using pubKey and validates signed attributes when present.

public bool Verify(X509Certificate cert)

Verify that the given certificate successfully handles and confirms the signature associated with this signer.