Hi everyone. I wonder if someone has some experiences with adding digital signature to xml files. What I want to do is, to sign the xml document with digital certificate (pfx file) installed on local machine. I saw xml dom 5 library has some of the required methods to do the signing, but I just can't figure out how to use it properly, so any suggestion is highly appreciated, thanks.
0
Comments
After installing the certificate you can try something like this in Navision:
WinHTTPReq: Automation 'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest
WebserviceEndpoint: Text
ClientCertificate: Text
TheXML: Text or a DOMDocument
WebserviceEndpoint := 'https://myWebserviceEndpoint';
ClientCertificate := 'LOCAL_MACHINE\My\TheCertificatesSubjectCN';
CREATE(WinHTTPReq);
WinHTTPReq.Open('POST',WebserviceEndpoint,FALSE);
WinHTTPReq.SetClientCertificate(ClientCertificate);
WinHTTPReq.Send(TheXML);
Good luck!
Klaus
You only need to know which elements you want to use in your signature block.
Then you could use the MSXML automations and build it. You don't need .NET for that.
Check out: http://www.w3.org/TR/xmldsig-core/
well actually it is not that simple