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

Encrypt() public static method

Create a multipart/encrypted MIME part by encrypting the specified entity.
Encrypts the entity to the specified recipients, encapsulating the result in a new multipart/encrypted part.
/// is null. /// -or- /// is null. /// /// One or more of the recipient keys cannot be used for encrypting. /// /// A default has not been registered. /// -or- /// The specified encryption algorithm is not supported. ///
public static Encrypt ( EncryptionAlgorithm algorithm, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
algorithm 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 Encrypt (EncryptionAlgorithm algorithm, IEnumerable<MailboxAddress> recipients, MimeEntity entity)
		{
			if (recipients == null)
				throw new ArgumentNullException ("recipients");

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

			using (var ctx = (OpenPgpContext) CryptographyContext.Create ("application/pgp-encrypted")) {
				return Encrypt (ctx, algorithm, recipients, entity);
			}
		}

Same methods

MultipartEncrypted::Encrypt ( EncryptionAlgorithm algorithm, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::Encrypt ( IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::Encrypt ( IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::Encrypt ( MimeKit.Cryptography.OpenPgpContext ctx, EncryptionAlgorithm algorithm, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::Encrypt ( MimeKit.Cryptography.OpenPgpContext ctx, EncryptionAlgorithm algorithm, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::Encrypt ( MimeKit.Cryptography.OpenPgpContext ctx, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted
MultipartEncrypted::Encrypt ( MimeKit.Cryptography.OpenPgpContext ctx, IEnumerable recipients, MimeEntity entity ) : MultipartEncrypted