|  | Multipart | 
 Syntax
Syntaxpublic static MultipartEncrypted SignAndEncrypt( OpenPgpContext ctx, MailboxAddress signer, DigestAlgorithm digestAlgo, EncryptionAlgorithm cipherAlgo, IEnumerable<MailboxAddress> recipients, MimeEntity entity, CancellationToken cancellationToken = default )
 Exceptions
Exceptions| Exception | Condition | 
|---|---|
| ArgumentNullException | ctx is . -or- signer is . -or- recipients is . -or- entity is . | 
| ArgumentException | signer cannot be used for signing. -or- One or more of the recipient keys cannot be used for encrypting. -or- No recipients were specified. | 
| ArgumentOutOfRangeException | The digestAlgo was out of range. | 
| NotSupportedException | The digestAlgo is not supported. -or- The cipherAlgo is not supported. | 
| ObjectDisposedException | entity has been disposed. | 
| OperationCanceledException | The user chose to cancel the password prompt. -or- The operation was canceled via the cancellation token. | 
| UnauthorizedAccessException | 3 bad attempts were made to unlock the secret key. | 
 Remarks
Remarks See Also
See Also