title: decrypt p7m file in C# or .NET with privateKey from file
body: <p>Hopefully someone can help me with code because I am working on it 3 months without any success. I tried almost anything from internet but nothing does not work.</p>
  
  <p>Problem: I have encrypted file p7m (size 158KB) (it is crypted text). I have certificate in file pfx, under password "a". In this certificate is the public key which is needed to decrypt p7m file.</p>
  
  <p>I need something that will read xyyv.p7m file, decrypt it with public key, and save it as XYZ.xyz</p>
  
  <p>I do not put here any my code to do not confuse you. thanks</p>