Click or drag to resize
MimeKit

OpenPgpContextImportAsync Method

Asynchronously import public pgp keys from the specified stream.

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

Parameters

stream  Stream
The raw key data.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

Task
An asynchronous task context.
Exceptions
ExceptionCondition
ArgumentNullExceptionstream is null.
IOException

An error occurred while parsing the raw key-ring data

-or-

An error occured while saving the public key-ring bundle.

OperationCanceledException The operation was canceled via the cancellation token.
Remarks
Asynchronously imports public pgp keys from the specified stream.
See Also