SmimeHashAlgorithm Property
Gets or sets the hash algorithm to use for signing messages with a digital signature.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public Algorithm HashAlgorithm { get; set; }

Property Value

Type: Algorithm
A reference to Algorithm object representing the hash algorithm to be used for signing messages. The default algorithm is SHA1.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionvalue is a null reference (Nothing in Visual Basic).
Remarks

Usually, there is no need to change the default value of this property.

In order to set this property, the developer can get Algorithm instance using CreateInstanceByOid(String) or CreateInstanceById(Int32) methods.

Examples
This sample sets SHA-256 hash algorithm if it's supported by the operating system (Thunderbird won't trust hashes produced by weaker algorithms).
// 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.HashAlgorithm = Algorithm.CreateInstanceByOid("2.16.840.1.101.3.4.2.1");
// To use SHA-384 or SHA-512, pass "2.16.840.1.101.3.4.2.2" or "2.16.840.1.101.3.4.2.3" respectively.
See Also