I got a problem with the Decrypt method of the Rebex component. I try to decrypt encrypted mails from our customers by calling the MailInfo.Decrypt methods. In most cases, this works fine, but for a small ammout of senders a NullReferenceException is thrown inside the Decrypt() method. The following example method demonstrates how we are using the decrypt method. The stack trace is appended below. Could you tell us, what is causing the exception and how we can fix it? Currently we are using Version 1.0.3588 of the Rebex component.
public void Test(Rebex.Mail.MailMessage mail) {
if (mail.CanDecrypt) {
mail.Decrypt(); // null reference exception occurs inside this method
}
}
bei Rebex.Security.Certificates.Certificate.Decrypt(Byte[] rgb, Boolean silent)
bei Rebex.Security.Cryptography.Pkcs.KeyTransRecipientInfo.720709612(Boolean )
bei Rebex.Security.Cryptography.Pkcs.EnvelopedData.GetSymmetricKey()
bei Rebex.Security.Cryptography.Pkcs.EnvelopedData.GetSymmetricAlgorithm()
bei Rebex.Security.Cryptography.Pkcs.EnvelopedData.Decrypt()
bei Rebex.Mime.MimeEntity.Decrypt()
bei Rebex.Mail.MailMessage.Decrypt()