Geeks With Blogs

Post Categories

Create Fun Things - Samer's Developer Blog Development Blog for C#, .NET and Obj-C

I was working this morning on hooking up the application I’ve been writing to Health Vault, and I came upon this fun little error “keyset does not exist” that is everywhere on bing and but lacking any clear instructions on how to fix it.

After about two hours of trying to figure out what exactly was going on, I finally have my application working. For both the purposes of helping others fix this error, and for me to remember what I did when I try to set up an application on our live server, I’ll write a post on how to fix this problem!

Step 1: Create a Certificate using the HealthVault Application Manager

I’m using version 1.1 to do this. Open it up from the Tools part of the HV SDK, and click Create New Certificate and name it after your application:



Then right click on it, and click to upload it to the HV platform:



Step 1.5: Copy your Application ID to your web.config file.

Right click again and select “Copy Application ID to Clipboard” and then place it in your (I’m assuming already set up web.config) file where it belongs.

Step 2: Export Public and Private keys (.pfx)

Right click once more, and click to export the public AND private keys. You want to make sure it’s saving as .pfx, not .cer:


Step 3: Delete the Certificate from the Healthvault Application Manager

Right click one last time, and click to “Delete Certificate.” We will instead be importing it using another tool, and granting the proper permissions for IIS to access the key.

Step 4: Navigate to the Computer Certificate Folder

Navigate to wherever you installed your SDK, and find the “tools” folder. From inside there, double click to open the “ComputerCertifcates” program.


Step 5: Import the Private Key

You should be already in the folder for Personal->Certificates. If not, navigate there using the side pane.

Right click, go to tasks, and choose to import a certificate.


Browse to where you saved your .pfx file from earlier and select it in this dialog:



Make sure when you click “browse”, you change the file types to find .pfx files:


Leave the password blank and hit next:


Click Ok to place it inside the Personal certificate store:


Then click Finish on the summary screen.

Step 6: Granting the Permissions to IIS

Check your start menu and start the Microsoft HealthVault SDK Command Prompt. It should be located under the Health Vault start menu folder.

Navigate to the Tools directory. (do so by typing in “cd tools” and hitting enter)



Inside the “tools” directory, you should see a program called winhttpcertcfg.exe . Using this program, you will grant IIS the proper permissions to access the certificate. I’m using Windows 7, and my application in IIS is set to run under the DefaultAppPool, which is set to run under "Network Service”. So I’ll be granting Network Service access to my program.

First, you can check to see what permissions your program already has by typing in the following:

winhttpcertcfg.exe -l -c LOCAL_MACHINE\My -s WildcatApp-YourCertificateNameHere

I haven’t given network service permissions yet, so I’ll see this:


Next I’ll run the command:

WinHttpCertCfg -g –a “Network Service” –c Local_machine\my –s WildcatApp-YourCertificateNameHere

And it should return this:



Summary: It *should* work now

That’s what I did to get it to finally work. It seems the Certificate manager that comes with the SDK can be a bit buggy in behavior, but this method worked just fine for me, after about 2 hours of fighting with it.

Hope this helped!



samer paul

Posted on Monday, August 3, 2009 12:23 PM | Back to top

Comments on this post: “Keyset does not exist” Health Vault Application Error with IIS

# re: “Keyset does not exist” Health Vault Application Error with IIS
Requesting Gravatar...
In the Application Configuration Manager, i dont have the Asp net under IIS and dev server are not cross checked. I cannot access the page that is inherting from health vault. Please help.
Left by bhavani on Oct 10, 2012 11:21 AM

Your comment:
 (will show your gravatar)

Copyright © samerpaul | Powered by: