tags:

views:

93

answers:

1

I have a file that is signed with a certificate located here.

CrytoAPI has not worked out for me because of server differences in 2003 / 2008+, and different file inputs.

I am now considering using Crypto++ to get the job done.

Essentially, all I would like to do is extract the text information from this file, and others like it, and save it as XML. There are some bits in the XML that are marked as < encoded data> but those sections are just base64 encoded, so I know exactly how to deal with the base64 encoded sections. My problem is before I can get to the XML envelope, I need to deal with the certificate thats obfuscating the plain text.

Anyone with experience in Crypto++ know how this is done?

With CrytoAPI, I was doing something like this :

byte[] fileContents = File.ReadAllBytes(outFileName);
var contentInfo = new ContentInfo(fileContents);
var signedCms = new SignedCms(contentInfo);
signedCms.Decode(fileContents);
signedCms.RemoveSignature(0);
byte[] outfileContent = signedCms.ContentInfo.Content;
A: 

Please can you elaborate on the error you're getting from the CryptoAPI, or is it CNG?

Doobi
Its cryptoAPI, I need a solution that works in 2003/2008+, hence CNG is out of the question. Issue when using this code is an ANS1 out of memory on files larger than 7MB on Windows 2008. Then with the LargeCMS workaround, errors of an invalid algorithm for 2003 machines.
JL
Here is the large CMS workaround I spoke of - http://stackoverflow.com/questions/2683867/invalid-algorithm-specified-on-windows-2003-server-only
JL