MimeKit.Cryptography.MultipartEncrypted.SignAndEncrypt C# (CSharp) Method

SignAndEncrypt() public static method

Create a multipart/encrypted MIME part by signing and encrypting the specified entity.
Signs the entity using the supplied signer and digest algorithm and then encrypts to the specified recipients, encapsulating the result in a new multipart/encrypted part.
/// is null. /// -or- /// is null. /// -or- /// is null. /// /// cannot be used for signing. /// -or- /// One or more of the recipient keys cannot be used for encrypting. /// -or- /// No recipients were specified. /// /// The was out of range. /// /// A default has not been registered. /// -or- /// The is not supported. /// -or- /// The is not supported. /// /// The user chose to cancel the password prompt. /// /// 3 bad attempts were made to unlock the secret key. ///
public static SignAndEncrypt ( MailboxAddress signer, DigestAlgorithm digestAlgo, EncryptionAlgorithm cipherAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
signer MailboxAddress The signer to use to sign the entity.
digestAlgo DigestAlgorithm The digest algorithm to use for signing.
cipherAlgo EncryptionAlgorithm The encryption algorithm.
recipients IEnumerable The recipients for the encrypted entity.
entity MimeEntity The entity to sign and encrypt.
return MultipartEncrypted
		public static MultipartEncrypted SignAndEncrypt (MailboxAddress signer, DigestAlgorithm digestAlgo, EncryptionAlgorithm cipherAlgo, IEnumerable<MailboxAddress> recipients, MimeEntity entity)
		{
			if (signer == null)
				throw new ArgumentNullException ("signer");

			if (recipients == null)
				throw new ArgumentNullException ("recipients");

			if (entity == null)
				throw new ArgumentNullException ("entity");

			using (var ctx = (OpenPgpContext) CryptographyContext.Create ("application/pgp-encrypted")) {
				return SignAndEncrypt (ctx, signer, digestAlgo, cipherAlgo, recipients, entity);
			}
		}

Same methods

MultipartEncrypted::SignAndEncrypt ( MailboxAddress signer, DigestAlgorithm digestAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::SignAndEncrypt ( MimeKit.Cryptography.OpenPgpContext ctx, MailboxAddress signer, DigestAlgorithm digestAlgo, EncryptionAlgorithm cipherAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::SignAndEncrypt ( MimeKit.Cryptography.OpenPgpContext ctx, MailboxAddress signer, DigestAlgorithm digestAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::SignAndEncrypt ( MimeKit.Cryptography.OpenPgpContext ctx, PgpSecretKey signer, DigestAlgorithm digestAlgo, EncryptionAlgorithm cipherAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::SignAndEncrypt ( MimeKit.Cryptography.OpenPgpContext ctx, PgpSecretKey signer, DigestAlgorithm digestAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::SignAndEncrypt ( PgpSecretKey signer, DigestAlgorithm digestAlgo, EncryptionAlgorithm cipherAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::SignAndEncrypt ( PgpSecretKey signer, DigestAlgorithm digestAlgo, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted