Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8149181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:47:50+00:00 2026-06-06T14:47:50+00:00

I am developing a WCF service, which uses SSL certificate for transport security. I

  • 0

I am developing a WCF service, which uses SSL certificate for transport security.

I followed various tutorial and hints online to generate and import the certificate. The certificate is imported using the following command:

certmgr.exe -add -all -c <filename>.pfx -s -r localMachine my

My WCF service is running happily using the imported certificate under console mode. Problem starts when I switched my service to be hosted with a Windows Service, which is running as “NETWORK SERVICE”. The exception is complaining that the application has no access to the private key installed.

So I used FindPrivateKey.exe and found out that the private key is actually installed in the current user’s AppData folder:

C:\Users\<username>\AppData\Roaming\Microsoft\Crypto\RSA\S-1-5-21-3289377140-263254259-3378496556-1105\d3a0de64e6f0513692d593a77a71d3ac_15824a33-515a-493c-a33f-38a7b852e11a

It would not work even if I grant “NETWORK SERVICE” user the access right to this file.

At the end I have to remove the certificate, and re-imported using MMC, which placed the private key to:

C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\c3ccd4300462fe2aa7cec7f747fbd075_15824a33-515a-493c-a33f-38a7b852e11a

So my question is, how can I get certmgr to place the private key in C:\ProgramData\ instead of current user’s AppData?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:47:51+00:00Added an answer on June 6, 2026 at 2:47 pm

    You should not try to work with certificates on file level. It is internal implementation that is not guarantied to be supported.

    There is a MS tool that can help you:

    The Microsoft Windows HTTP Services (WinHTTP) certificate
    configuration tool, “WinHttpCertCfg.exe”, enables administrators to
    install and configure client certificates in any certificate store
    that can be accessed by the Internet Server Web Application Manager
    (IWAM) account.

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa384088(v=vs.85).aspx

    Command that you need to run:

    This command grants access to the private key of the “MyCertificate”
    certificate in the “My” certificate store for the TESTUSER account.

    winhttpcertcfg -g -c LOCAL_MACHINE\My -s MyCertificate -a TESTUSER
    

    Use this link to install the tool:

    http://www.microsoft.com/en-us/download/details.aspx?id=19801

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're in the process of developing a WCF REST web service which just receives
I'm developing a web-service using WCF, which I want to access using a client
I am developing a RESTful WCF service which I then want to consume from
We are developing a selfhosted WCF service host which will be loading services dynamically
I am developing a WCF service which follows MSDN's service archetype . That said,
I am developing an application which includes a WCF service and its ASP.NET MVC
I'm developing a WPF Client which interacts with a WCF Web Service which persists
I am developing a silverlight 4.0 application which communicates with a WCF service. The
I am developing a WPF application in .NET 4.0 which calls a WCF Service
I am developing a WCF service which can be consumed by mobile applications to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.