Click or drag to resize

SignedCmsBuilderSign Method

Signs current PKCS#7 message and adds a new signer information to SignerInfos collection. Certificates specified in chain parameter are added to Certificates collection.

Namespace:  SysadminsLV.PKI.Cryptography.Pkcs
Assembly:  SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 3.7.0.0 (3.7.0.0)
Syntax
public DefaultSignedPkcs7 Sign(
	MessageSigner signer,
	X509Certificate2Collection chain = null
)

Parameters

signer
Type: SysadminsLV.PKI.Tools.MessageOperationsMessageSigner
signing object that contains public certificate, private key and signing configuration.
chain (Optional)
Type: System.Security.Cryptography.X509CertificatesX509Certificate2Collection
Signing certificate chain to add to CMS. This parameter is optional. If not specified, only leaf (signing) certificate is added to Certificates collection and signed message.

Return Value

Type: DefaultSignedPkcs7
An instance of DefaultSignedPkcs7 class that represents signed CMS message.
Exceptions
ExceptionCondition
InvalidOperationException No data to sign was passed in the constructor.
Remarks
You can call this method multiple times to attach multiple signatures to signed CMS message.
See Also