views:

86

answers:

1

I have a C# application that uses XML digital signatures to sign license files. I've used the standard Microsoft approach described here.

I'm porting the application to the MAC and need to verify the signature. My general question is how best to do this?

This is what I've done:

  • I've used macport to install Aleksey's xmlsec1 library.

  • Used the Chilkat library to convert my XML public key to a PEM file

    Chilkat.PublicKey pubKey = new Chilkat.PublicKey(); pubKey.LoadXml(publicKeyXml); pubKey.SaveOpenSslPemFile("publicKey.pem");

  • Compiled and ran the alekseys sample program. See (http://www.aleksey.com/xmlsec/api/xmlsec-verify-with-key.html) to verify an XML dsig.

Result: my license files fail to validate. The call to xmlSecDSigCtxVerify fails with status=unknown. Now for my specific question: What can I do next?

Geoff

+1  A: 

The solution was to define:

#define XMLSEC_NO_SIZE_T

before including any of the xmlsec header files. Otherwise the type xmlSecSize will be defined differently to when the program was built on the Mac and the xmlSecDSigCtx structure will appear corrupted to the library. See xmlsec.h for details.

Geoff