/// <summary>
 /// Takes a <see cref="MultipartEntity"/>, encrypts it with a collection of certificates,
 /// and returns a MimeEntity with the associated
 /// content headers for encrypted content and the encrypted body.
 /// </summary>
 /// <remarks>
 /// As specified in the S/MIME and CMS RFCs, encryption uses symetric encryption to encrypt the body, and
 /// certificate-based asymetric encryption to encrypt the encryption key used. With multiple certificates,
 /// there will be multiple copies of the encrypted encryption key.
 /// </remarks>
 /// <param name="entity">The <see cref="MultipartEntity"/>, including content header and body, to encrypt</param>
 /// <param name="encryptingCertificates">The collection of certificate used for encrytion</param>
 /// <returns>The encrypted mime entity.</returns>
 public MimeEntity Encrypt(MultipartEntity entity, X509Certificate2Collection encryptingCertificates)
 {
     return(Encrypt(entity.ToEntity(), encryptingCertificates));
 }
示例#2
0
 /// <summary>
 /// Takes a <see cref="MultipartEntity"/>, encrypts it with a collection of certificates,
 /// and returns a MimeEntity with the associated
 /// content headers for encrypted content and the encrypted body.
 /// </summary>
 /// <remarks>
 /// As specified in the S/MIME and CMS RFCs, encryption uses symetric encryption to encrypt the body, and
 /// certificate-based asymetric encryption to encrypt the encryption key used. With multiple certificates,
 /// there will be multiple copies of the encrypted encryption key.
 /// </remarks>
 /// <param name="entity">The <see cref="MultipartEntity"/>, including content header and body, to encrypt</param>
 /// <param name="encryptingCertificates">The collection of certificate used for encrytion</param>
 /// <returns>The encrypted mime entity.</returns>
 public MimeEntity Encrypt(MultipartEntity entity, X509Certificate2Collection encryptingCertificates)
 {
     return Encrypt(entity.ToEntity(), encryptingCertificates);
 }
 //-----------------------------------------------------
 //
 // Encryption
 //
 //-----------------------------------------------------
 /// <summary>
 /// Takes a <see cref="MultipartEntity"/>, encrypts it, and returns a MimeEntity with the associated
 /// content headers for encrypted content and the encrypted body.
 /// </summary>
 /// <param name="entity">The <see cref="MultipartEntity"/>, including content header and body, to encrypt</param>
 /// <param name="encryptingCertificate">The certificate used for encrytion</param>
 /// <returns>The encrypted mime entity.</returns>
 public MimeEntity Encrypt(MultipartEntity entity, X509Certificate2 encryptingCertificate)
 {
     return(Encrypt(entity.ToEntity(), encryptingCertificate));
 }
示例#4
0
 //-----------------------------------------------------
 //
 // Encryption
 //
 //-----------------------------------------------------
 /// <summary>
 /// Takes a <see cref="MultipartEntity"/>, encrypts it, and returns a MimeEntity with the associated
 /// content headers for encrypted content and the encrypted body.
 /// </summary>
 /// <param name="entity">The <see cref="MultipartEntity"/>, including content header and body, to encrypt</param>
 /// <param name="encryptingCertificate">The certificate used for encrytion</param>
 /// <returns>The encrypted mime entity.</returns>
 public MimeEntity Encrypt(MultipartEntity entity, X509Certificate2 encryptingCertificate)
 {
     return Encrypt(entity.ToEntity(), encryptingCertificate);
 }