|  | Open | 
 Syntax
Syntaxpublic Task<MimePart> SignAndEncryptAsync( PgpSecretKey signer, DigestAlgorithm digestAlgo, IEnumerable<PgpPublicKey> recipients, Stream content, CancellationToken cancellationToken = default )
 Exceptions
Exceptions| Exception | Condition | 
|---|---|
| ArgumentNullException | signer is . -or- recipients is . -or- content 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. | 
| 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