locked
Keyset does not exist RRS feed

  • Question

  • I copied my Healthvault website to the webserver. I also exported my certificate to the new server using HV SDK App Manager. I then imported the certificate on the new webserver using HV SDK App Manager. When I try to acces this website using internet I get the following error (copied below). Please let me know what am I missing? Thanks.

    "
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Security.Cryptography.CryptographicException: Keyset does not exist


    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [CryptographicException: Keyset does not exist
    ]
    System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +7712542
    System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) +67
    System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() +83
    System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) +226
    System.Security.Cryptography.RSACryptoServiceProvider..ctor(CspParameters parameters) +9
    System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() +202
    Microsoft.Health.ApplicationConfiguration.GetSignatureCertRsaProvider(Guid applicationId, RSACryptoServiceProvider& rsaProvider, String& thumbprint) +383
    Microsoft.Health.Web.Authentication.WebApplicationCredential.SetupSignatureCertRsaProvider() +139
    Microsoft.Health.Web.Authentication.WebApplicationCredential.Initialize(Guid applicationId) +270
    Microsoft.Health.Web.Authentication.WebApplicationCredential..ctor(Guid applicationId, String subCredential) +217
    Microsoft.Health.Web.WebApplicationUtilities.GetPersonInfo(String authToken) +101
    Microsoft.Health.Web.WebApplicationUtilities.HandleTokenOnUrl(HttpContext context, Boolean isLoginRequired) +152
    Microsoft.Health.Web.WebApplicationUtilities.PageOnPreLoad(HttpContext context, Boolean logOnRequired) +56
    Microsoft.Health.Web.HealthServicePage.OnPreLoad(EventArgs e) +69
    "
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +554


    Version Information:  Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

    Deep
    Monday, March 30, 2009 4:28 PM

Answers

  • Check the following.

    1. Did you export the certifcate with private key (pfx) from the original web server?  If you just exported without private key, (.cer) this problem would occur. If you did that, delete the cerficate and reimport it again after exporting it WITH the private key as .pfx file.

    2. Check if you have granted the IIS worker process enough permissions to access the certificate. 

    My guess is that you problem is #1 above.

    Raj
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, March 30, 2009 5:31 PM

All replies

  • Check the following.

    1. Did you export the certifcate with private key (pfx) from the original web server?  If you just exported without private key, (.cer) this problem would occur. If you did that, delete the cerficate and reimport it again after exporting it WITH the private key as .pfx file.

    2. Check if you have granted the IIS worker process enough permissions to access the certificate. 

    My guess is that you problem is #1 above.

    Raj
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, March 30, 2009 5:31 PM
  • Yes I exported pfx and also did "Grant access to IIS process". Infact I did the whole process again (export pfx, import and Grant access to IIS process). Now I get a different error copid below.

    When I use a new tab on the same browser to access the local application I am able to browse. I am also able to browse other Live ID related websites alike HV Forum and HV PPE. Why can't I browse the application on my server. Am I supposed to do some settings on the IIS?

    Thanks in advance for your help.

    Error:
    "

    Windows Live ID is unavailable from this site for one of the following reasons:
    • This site may be experiencing a problem.
    • The site may not be a member of Windows Live ID.

    You can:

    • You can sign in or sign up at other Windows Live ID sites and services, or try again later at this site.
    "



    Deep
    Monday, March 30, 2009 5:49 PM
  • I see that you have started a new thread for the error you are getting now...

    I have posted a response in that

    http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/f2e6b395-87d9-42df-aba8-5dc036ebbe91



    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, March 30, 2009 5:57 PM