ISecureMimeContextImport(Stream, String, CancellationToken) Method

Imports certificates and keys from a pkcs12-encoded stream.

Definition

Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
void Import(
	Stream stream,
	string password,
	CancellationToken cancellationToken = default
)

Parameters

stream  Stream
The raw certificate and key data.
password  String
The password to unlock the stream.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Remarks

Imports certificates and keys from a pkcs12-encoded stream.

Exceptions

ArgumentNullException

stream is .

-or-

password is .

NotSupportedException Importing keys is not supported by this cryptography context.
OperationCanceledException The operation was cancelled via the cancellation token.

See Also