I am trying to read digitally signed emails in EWS. Specifically I am interested in the file attachments in the email. I am using the following code with no success:
SignedCms signedCms = new SignedCms();
signedCms.Decode(filebyte)
Where filebyte is the smime.p7m attachment.
I get the error "ASN1 bad tag value met." on the second line of the code.
Can anybody help me figure out the issue? Am I missing a certificate on the machine that runs the code? Or is the certificate already in the smime.p7m? Am I not supposed to pass smime.p7m attachment to decode?