Default Secure Mime ContextImport Async(Stream, String, Cancellation Token) Method
Asynchronously imports 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 override Task ImportAsync(
Stream stream,
string password,
CancellationToken cancellationToken = default
)Parameters
- stream Stream
- The raw certificate and key data.
- password String
- The password to unlock the data.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TaskAn asynchronous task context.
Implements
ISecureMimeContextImportAsync(Stream, String, CancellationToken)Remarks
Asynchronously imports all the certificates and keys from the pkcs12-encoded stream.
Exceptions
| ArgumentNullException |
stream is . -or- password is . |
| OperationCanceledException | The operation was canceled via the cancellation token. |
| CmsException | An error occurred in the cryptographic message syntax subsystem. |