Re: CryptAcquireContext fails with error 6 (The handle is invalid)

From: Carlos Lopez (clopezonline_at_microsoft.com)
Date: 10/26/04


Date: Tue, 26 Oct 2004 20:34:27 GMT

Phil,

Sorry for the confusion. The winhttpcertconfig tool only changes a
certificate's private key container not just any container.

You did say before that are changing the permission on the container. Why
don't you just give NETWORK SERVICE and LOCAL SERVICE access to the key
container just like you did with IIS_WPG?

Thanks
Carlos

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Phil Ten" <pt@dafweb.com>
| References: <eA5bfAVoEHA.2380@TK2MSFTNGP14.phx.gbl>
<XCCr5leoEHA.3944@cpmsftngxa06.phx.gbl>
<eF#40ThoEHA.3460@tk2msftngp13.phx.gbl>
<8dk5QdGpEHA.4048@cpmsftngxa06.phx.gbl>
<eN3QUsGpEHA.648@tk2msftngp13.phx.gbl>
<B6viXETpEHA.1340@cpmsftngxa06.phx.gbl>
<#EeU9yTpEHA.1712@tk2msftngp13.phx.gbl>
<jUr6531pEHA.3944@cpmsftngxa06.phx.gbl>
<uvoWit5pEHA.3900@TK2MSFTNGP10.phx.gbl>
<g9OClNtqEHA.3356@cpmsftngxa06.phx.gbl>
<uuBzmU4qEHA.592@TK2MSFTNGP11.phx.gbl>
<psrUlLZsEHA.2092@cpmsftngxa10.phx.gbl>
<u9m6ASdsEHA.2788@TK2MSFTNGP09.phx.gbl>
<15LwO4ksEHA.1092@cpmsftngxa10.phx.gbl>
<O9snAersEHA.3200@TK2MSFTNGP09.phx.gbl>
<H6SdtditEHA.764@cpmsftngxa10.phx.gbl>
| Subject: Re: CryptAcquireContext fails with error 6 (The handle is
invalid)
| Date: Tue, 26 Oct 2004 12:26:06 +0100
| Lines: 207
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.181
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181
| Message-ID: <u#JskT0uEHA.2016@TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.platformsdk.security
| NNTP-Posting-Host: philten.dafpro.com 62.212.108.88
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa0
6.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.platformsdk.security:9687
| X-Tomcat-NG: microsoft.public.platformsdk.security
|
| Thank you for your posts.
|
| I wanted to test your suggestion, unfortunately, I couldn't get
| WinHttpCertCfg.exe to work as expected. I assume I not specifying
| the correct parameters but even with the tool documentation I couldn't
| find the solution.
|
| When I trie the sample found in the documentation with my container:
|
| winhttpcertcfg /l /c local_machine\root /s DAFCryptoContainer
| The tool returns:
| Error: Unable to find or obtain a context for requested certificate
| Reminder, my container was created with:
|
| CryptAcquireContext(&m_hCryptProv,"DAFCryptoContainer",
| MS_ENHANCED_PROV,PROV_RSA_FULL,
| CRYPT_MACHINE_KEYSET|CRYPT_NEWKEYSET))
|
| Thank you for your help.
|
| Phil. Ten.
|
|
| ""Carlos Lopez"" <clopezonline@microsoft.com> wrote in message
| news:H6SdtditEHA.764@cpmsftngxa10.phx.gbl...
| > Phil,
| >
| > You can check/change the permissions on a key container with the
| > WinHttpCertCfg.exe.
| >
| > Instructions on how to get the tool are here:
| > http://support.microsoft.com/?id=823193
| >
| > Thanks
| > Carlos
| >
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > --------------------
| > | From: "Phil Ten" <pt@dafweb.com>
| > | References: <eA5bfAVoEHA.2380@TK2MSFTNGP14.phx.gbl>
| > <XCCr5leoEHA.3944@cpmsftngxa06.phx.gbl>
| > <eF#40ThoEHA.3460@tk2msftngp13.phx.gbl>
| > <8dk5QdGpEHA.4048@cpmsftngxa06.phx.gbl>
| > <eN3QUsGpEHA.648@tk2msftngp13.phx.gbl>
| > <B6viXETpEHA.1340@cpmsftngxa06.phx.gbl>
| > <#EeU9yTpEHA.1712@tk2msftngp13.phx.gbl>
| > <jUr6531pEHA.3944@cpmsftngxa06.phx.gbl>
| > <uvoWit5pEHA.3900@TK2MSFTNGP10.phx.gbl>
| > <g9OClNtqEHA.3356@cpmsftngxa06.phx.gbl>
| > <uuBzmU4qEHA.592@TK2MSFTNGP11.phx.gbl>
| > <psrUlLZsEHA.2092@cpmsftngxa10.phx.gbl>
| > <u9m6ASdsEHA.2788@TK2MSFTNGP09.phx.gbl>
| > <15LwO4ksEHA.1092@cpmsftngxa10.phx.gbl>
| > | Subject: Re: CryptAcquireContext fails with error 6 (The handle is
| > invalid)
| > | Date: Fri, 15 Oct 2004 15:13:14 +0100
| > | Lines: 122
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.3790.181
| > | X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.3790.181
| > | Message-ID: <O9snAersEHA.3200@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.platformsdk.security
| > | NNTP-Posting-Host: philten.dafpro.com 62.212.108.88
| > | Path:
| >
|
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
| > phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.platformsdk.security:9539
| > | X-Tomcat-NG: microsoft.public.platformsdk.security
| > |
| > | Thank you for your posts.
| > |
| > | I applied the suggested permissions and it did not help.
| > | I still get the same symptom.
| > |
| > | I posted the question below several times in this
| > | thread, unfortunately with no answer. If someone could
| > | reply I would appreciate very much:
| > |
| > | How could I check the actual permission applied
| > | to a crypto container?
| > |
| > | Also, I couldn't find any information on how and
| > | where are stored crypto containers?
| > |
| > | Thank you
| > |
| > | Phil. Ten.
| > |
| > |
| > |
| > | ""Carlos Lopez"" <clopezonline@microsoft.com> wrote in message
| > | news:15LwO4ksEHA.1092@cpmsftngxa10.phx.gbl...
| > | > Hi Phil,
| > | >
| > | > Here are the values:
| > | > Read Data = FILE_READ_DATA
| > | > Read Extended Attributes = FILE_READ_EA
| > | > Read Permissions = READ_CONTROL
| > | > Synchronize = SYNCHRONIZE
| > | >
| > | > Thanks
| > | > Carlos
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > --------------------
| > | > | From: "Phil Ten" <pt@dafweb.com>
| > | > | References: <eA5bfAVoEHA.2380@TK2MSFTNGP14.phx.gbl>
| > | > <XCCr5leoEHA.3944@cpmsftngxa06.phx.gbl>
| > | > <eF#40ThoEHA.3460@tk2msftngp13.phx.gbl>
| > | > <8dk5QdGpEHA.4048@cpmsftngxa06.phx.gbl>
| > | > <eN3QUsGpEHA.648@tk2msftngp13.phx.gbl>
| > | > <B6viXETpEHA.1340@cpmsftngxa06.phx.gbl>
| > | > <#EeU9yTpEHA.1712@tk2msftngp13.phx.gbl>
| > | > <jUr6531pEHA.3944@cpmsftngxa06.phx.gbl>
| > | > <uvoWit5pEHA.3900@TK2MSFTNGP10.phx.gbl>
| > | > <g9OClNtqEHA.3356@cpmsftngxa06.phx.gbl>
| > | > <uuBzmU4qEHA.592@TK2MSFTNGP11.phx.gbl>
| > | > <psrUlLZsEHA.2092@cpmsftngxa10.phx.gbl>
| > | > | Subject: Re: CryptAcquireContext fails with error 6 (The handle is
| > | > invalid)
| > | > | Date: Thu, 14 Oct 2004 12:08:16 +0100
| > | > | Lines: 47
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.3790.181
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181
| > | > | Message-ID: <u9m6ASdsEHA.2788@TK2MSFTNGP09.phx.gbl>
| > | > | Newsgroups: microsoft.public.platformsdk.security
| > | > | NNTP-Posting-Host: philten.dafpro.com 62.212.108.88
| > | > | Path:
| > | >
| > |
| >
|
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
| > | > phx.gbl
| > | > | Xref: cpmsftngxa10.phx.gbl
| microsoft.public.platformsdk.security:9524
| > | > | X-Tomcat-NG: microsoft.public.platformsdk.security
| > | > |
| > | > | No, I still didn't solve this issue.
| > | > |
| > | > | I am not sure how to try Carlos's suggestion because I do
| > | > | not know how to change permission on a container
| > | > | beside using my C function listed in a previous post
| > | > | in this thread.
| > | > |
| > | > | Is there a simple way to change permission on a container?
| > | > |
| > | > | If the only way is by program, what constants should
| > | > | I use to set the suggested permission below?
| > | > |
| > | > | Read Data = FILE_READ_DATA
| > | > | Read Extended Attributes = ???
| > | > | Read Permissions = ???
| > | > | Synchronize = ???
| > | > |
| > | > | Thank you for your help
| > | > |
| > | > | Phil. Ten.
| > | > |
| > | > |
| > | > | "Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> wrote in
| message
| > | > | news:psrUlLZsEHA.2092@cpmsftngxa10.phx.gbl...
| > | > | > Hello Phil,
| > | > | >
| > | > | > How is everything going? If you are still monitoring this issue,
| > could
| > | > you
| > | > | > please try Carlos's suggestion and let us know whether it works?
| We
| > | look
| > | > | > forward to your response.
| > | > | >
| > | > | > Thanks very much.
| > | > | >
| > | > | > Best regards,
| > | > | > Yanhong Huang
| > | > | > Microsoft Community Support
| > | > | >
| > | > | > Get Secure! ¨C www.microsoft.com/security
| > | > | > Register to Access MSDN Managed Newsgroups!
| > | > | >
| > | >
| >
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.
| > | > | as
| > | > | > p&SD=msdn
| > | > | >
| > | > | > This posting is provided "AS IS" with no warranties, and confers
| no
| > | > | rights.
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|



Relevant Pages

  • Re: Exchange 2007 installation error
    ... Given, however, what I saw in terms of permission changes to the container ... ports on the Exchange Server before it is deployed again..... ... I had no problems installing it at that time. ...
    (microsoft.public.exchange.setup)
  • Re: Computer Objects
    ... DELETE on the object being moved or DELETE_CHILD on the source container ... > I am trying to find the correct permission to delegate the authority to MOVE ... > delete computer objects is available per OU, but I would also like delegate ...
    (microsoft.public.win2000.active_directory)
  • Re: CryptAcquireContext fails with error 6 (The handle is invalid)
    ... You can check/change the permissions on a key container with the ... | From: "Phil Ten" ... | I applied the suggested permissions and it did not help. ... | How could I check the actual permission applied ...
    (microsoft.public.platformsdk.security)
  • Re: Check SLP in AD
    ... container manually and grant the site systems full permission to this ... container only. ... > on the system container object and all child objects. ...
    (microsoft.public.sms.admin)
  • Re: CryptAcquireContext fails with error 6 (The handle is invalid)
    ... As far as why both accounts are not part of the IIS_WPG I did not research ... any potential problem just give both accounts access to the key container. ... | from the beginning and, indeed, NETWORK SERVICE" and "LOCAL SERVICE" ...
    (microsoft.public.platformsdk.security)