Multipart EncryptedDecrypt(Cancellation Token) Method
Decrypts the MultipartEncrypted part.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
The decrypted entity.
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public MimeEntity Decrypt(
CancellationToken cancellationToken = default
)Parameters
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
MimeEntityThe decrypted entity.
Implements
IMultipartEncryptedDecrypt(CancellationToken)Remarks
Decrypts the MultipartEncrypted part.
Exceptions
| FormatException |
The protocol parameter was not specified. -or- The multipart is malformed in some way. |
| NotSupportedException | A suitable CryptographyContext for decrypting could not be found. |
| PrivateKeyNotFoundException | The private key could not be found to decrypt the encrypted data. |
| ObjectDisposedException | The MultipartEncrypted has been disposed. |
| OperationCanceledException |
The user chose to cancel the password prompt. -or- The operation was cancelled via the cancellation token. |
| UnauthorizedAccessException | 3 bad attempts were made to unlock the secret key. |