Click or drag to resize
MimeKit

CmsRecipient(String, SubjectIdentifierType) Constructor

Initialize a new instance of the CmsRecipient class.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public CmsRecipient(
	string fileName,
	SubjectIdentifierType recipientIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber
)

Parameters

fileName  String
The file containing the recipient's certificate.
recipientIdentifierType  SubjectIdentifierType  (Optional)
The recipient identifier type.
Exceptions
ExceptionCondition
ArgumentNullExceptionfileName is null.
ArgumentExceptionfileName is a zero-length string, contains only white space, or contains one or more invalid characters.
DirectoryNotFoundExceptionfileName is an invalid file path.
FileNotFoundException The specified file path could not be found.
UnauthorizedAccessException The user does not have access to read the specified file.
FormatException The specified file does not contain a certificate.
IOException An I/O error occurred.
Remarks

Creates a new CmsRecipient, loading the certificate from the specified file.

If the X.509 certificate contains an S/MIME capability extension, the initial value of the EncryptionAlgorithms property will be set to whatever encryption algorithms are defined by the S/MIME capability extension, otherwise int will be initialized to a list containing only the Triple-Des encryption algorithm which should be safe to assume for all modern S/MIME v3.x client implementations.

See Also