MailMessage.CheckSignature

CheckSignature(string)

Checks the signature of the specified eml file.

public static bool CheckSignature(string fileName)
ParameterTypeDescription
fileNameStringA file name (eml).

Return Value

True if signature is valid; otherwise, false.

Exceptions

exceptioncondition
ArgumentExceptionfileName is null or empty.
FileNotFoundExceptionThe specified fileName doesn’t exist.
NotSupportedExceptionSignature type is not supported.
InvalidOperationExceptionMail message is not signed or signature type is not specified.

See Also


CheckSignature(Stream)

Checks the signature of the specified eml message.

public static bool CheckSignature(Stream stream)
ParameterTypeDescription
streamStreamA stream containing the message in eml format.

Return Value

True if signature is valid; otherwise, false.

Exceptions

exceptioncondition
ArgumentNullExceptionstream is null.
NotSupportedExceptionSignature type is not supported.
InvalidOperationExceptionMail message is not signed or signature type is not specified.

See Also


CheckSignature()

Checking signature exsisting MailMessage.

public virtual X509Certificate2[] CheckSignature()

Return Value

X.509 signers certificates

Exceptions

exceptioncondition
InvalidOperationExceptionThrows if Mail message is not signed or signature is not verified.

See Also