Click or drag to resize
MimeKit

DefaultSecureMimeContextImport(X509Certificate, Boolean, CancellationToken) Method

Import a certificate.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.10.0
Syntax
C#
public void Import(
	X509Certificate certificate,
	bool trusted,
	CancellationToken cancellationToken = default
)

Parameters

certificate  X509Certificate
The certificate.
trusted  Boolean
if the certificate is trusted; otherwise, .
cancellationToken  CancellationToken  (Optional)
The cancellation token.
Exceptions
ExceptionCondition
ArgumentNullExceptioncertificate is .
OperationCanceledException The operation was canceled via the cancellation token.
Remarks

Imports the certificate.

If the certificate already exists in the database and trusted is , then the IsTrusted state is updated otherwise the certificate is added to the database with the specified trust.

See Also