user3436940
user3436940

Reputation: 1

C# Decrypt AES Mail EAGetMail / Chilkat

I try to decrypt a AES encrypted mail. I can receive the mail but when i save the Attachement it is a smime.p7m file but i cannot decrpyt it. I tried to use Chilkat or EAGetMail to decrpyt it.

Do I Need a certificate or private/public key?

 Mail oMail = oClient.GetMail(info);
 Certificate oCert = new Certificate();
 oCert.Load("E:\\Programme\\Email_Verarbeitung\\tt.cer");
 try
 {
      oMail = oMail.Decrypt(oCert);
 }
 catch (Exception ert) { Log.writeLog(ert.Source + "_" + ert.Message); }

I get the Error-Message:

EAGetMail20_Cannot find the certificate and private key to use for decryption

Has anyone an idea?

Upvotes: 0

Views: 270

Answers (1)

Davin Tryon
Davin Tryon

Reputation: 67336

From the EAGetMail documentation:

pfx and cer

*.pfx certificate contains public/private key and *.cer only contains public key, so *.pfx is able to decrypt email while *.cer is used to encrypted email only. *.pfx and *.cert can be exported by "Control Pannel"->"Internet Options"->"Content"->"Certificates". If importing private key is chosen, the *.pfx will be generated, otherwise *.cer will be generated.

In order to decrypt you need the private key. So, it seems that you should be using a .pfx file.

Upvotes: 1

Related Questions