Hello,
This is a licensed version of Secure Mail component. I'm using the same code indicated in S/MIME Tutorial page as follows:
`
private void buttonLoadEml_Click(object sender, EventArgs e)
{
try
{
string emlFileName = GetEmlFilePath();
if (string.IsNullOrEmpty(emlFileName))
{
return;
}
MailMessage message = new MailMessage();
message.Load(emlFileName);
// decrypt the message if it is encrypted
if (message.IsEncrypted)
{
if (!message.CanDecrypt)
throw new ApplicationException
(
"Message cannot be decrypted. You do not have the private key."
);
message.Decrypt();
}
this.textBox1.Text = message.BodyText;
}
catch (Exception ex)
{
this.textBox1.Text = ex.ToString();
}
}
`
Here are the exception details:
System.FormatException: Input string was not in a correct format.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at AzIwhU.bjJTWY.bbBzTnZ(Byte[] )
at Rebex.Security.Cryptography.Pkcs.EnvelopedData.Decrypt()
at Rebex.Mime.MimeEntity.Decrypt()
at Rebex.Mail.MailMessage.Decrypt()
at CertificateEnumerator.MainForm.buttonLoadEml_Click(Object sender, EventArgs e) in C:\Users\inm\Documents\Visual Studio 2008\Projects\CertificateEnumerator\CertificateEnumerator\MainForm.cs:line 173