The amount of code to achieve this is not too much as shown with the shipped examples, but it’s the configuration of the client and server machine what is the challenge. There is good documentation what will get you a long way. But I ran into a little issue on “How to: Make X.509 Certificates Accessible to WSE”
Give the account under which WSE is running read access to the file containing the private key associated with the X.509 certificate.
- Open the WSE X.509 Certificate Tool (WseCertificate2.exe)
- Set the certificate location and store name where the certificate is located.
- Click Select the certificate from the store, choose the certificate you
want to set the permissions for, and then click OK.
- Click Open Private Key File Properties, click the Security tab, add the ASPNET or Network Service account, depending on which version of IIS the Web service is running under, and then select the Read option.
The missing documentation is that if the Security tab is not showing you have to make sure the following:
- You need the NTFS file format.
- Open the explorer and go to ->Folder Options, click on the View Tab, and deselect “Use simple file sharing [recommended]”
Step d. should now show the Security tab, and the Read access to the security file can
be set for the IE account (ASPNET or Network Service for IE 6.0)