Windows Secure Mime ContextImport Async(Stream, String, X509Key Storage Flags, Cancellation Token) Method
Asynchronously import certificates and keys from a pkcs12-encoded stream.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
An asynchronous task context.
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
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
TaskAn asynchronous task context.
Remarks
Asynchronously imports certificates and keys from a pkcs12-encoded stream.
Exceptions
| ArgumentNullException |
stream is . -or- password is . |
| OperationCanceledException | The operation was cancelled via the cancellation token. |