SmimeEncryptionAlgorithm Property
Gets or sets the algorithm to use for encrypting messages.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public Algorithm EncryptionAlgorithm { get; set; }

Property Value

Type: Algorithm
A reference to Algorithm object representing the algorithm to be used for encrypting messages. The default algorithm is RSA DES (szOID_RSA_DES_EDE3_CBC).
MailBeeInvalidArgumentExceptionvalue is a null reference (Nothing in Visual Basic).

Usually, there is no need to change the default value of this property. However, if you want to use another encryption algorithm (e.g. AES-256), you can get Algorithm instance using CreateInstanceByOid(String) or CreateInstanceById(Int32) methods.

This sample sets AES-256 encryption algorithm (we assume if it's supported by the operating system).
// To use the code below, import MailBee namespace at the top of your code
using MailBee.Security;

// The actual code (put it into a method of your class)

Smime objSmime = new Smime();
objSmime.EncryptionAlgorithm = Algorithm.CreateInstanceByOid("2.16.840.");
See Also