Click or drag to resize
MimeKit

WindowsSecureMimeContextImportAsync(Stream, String, X509KeyStorageFlags, CancellationToken) Method

Asynchronously import certificates and keys from a pkcs12-encoded stream.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public Task ImportAsync(
	Stream stream,
	string password,
	X509KeyStorageFlags flags,
	CancellationToken cancellationToken = default
)

Parameters

stream  Stream
The raw certificate and key data.
password  String
The password to unlock the stream.
flags  X509KeyStorageFlags
The storage flags to use when importing the certificate and private key.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

Task
An asynchronous task context.
Exceptions
ExceptionCondition
ArgumentNullException

stream is null.

-or-

password is null.

OperationCanceledException The operation was cancelled via the cancellation token.
Remarks
Asynchronously imports certificates and keys from a pkcs12-encoded stream.
See Also