Click or drag to resize
MimeKit

ApplicationPkcs7MimeSignAndEncrypt Method (CmsSigner, CmsRecipientCollection, MimeEntity)

Cryptographically signs and encrypts the specified entity.

Namespace:  MimeKit.Cryptography
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public static ApplicationPkcs7Mime SignAndEncrypt(
	CmsSigner signer,
	CmsRecipientCollection recipients,
	MimeEntity entity
)

Parameters

signer
Type: MimeKit.CryptographyCmsSigner
The signer.
recipients
Type: MimeKit.CryptographyCmsRecipientCollection
The recipients.
entity
Type: MimeKitMimeEntity
The entity.

Return Value

Type: ApplicationPkcs7Mime
The signed and encrypted entity.
Exceptions
ExceptionCondition
ArgumentNullException

signer is null.

-or-

recipients is null.

-or-

entity is null.

CmsException An error occurred in the cryptographic message syntax subsystem.
Remarks
Cryptographically signs entity using the supplied signer and the default SecureMimeContext and then encrypts the result to the specified recipients.
See Also