Milan, Thankyou - never thought of passing 0 - it works.
I used CRYPT_MACHINE_KEYSET because msdn told me that was what I needed for services. On another note, if I have a service and I install a certificate into that service acct via mmc add certificates, service acct. Would I need to change parameters passed to the CertFindContext() Fn()? I presume yes... Thanks Steve -----Original Message----- From: Milan Tomic [mailto:[EMAIL PROTECTED] Sent: 27 July 2005 11:41 To: security-dev@xml.apache.org Subject: RE: WinCAPICryptoProvider(NULL, NULL, CRYPT_MACHINE_KEYSET) - CryptAquireContext() fails when I run a process as a restriced user Is there any specific reason that you are using (need) CRYPT_MACHINE_KEYSET flag? Have you tried this: Obj = WinCAPICryptoProvider(NULL, NULL, 0) Best regards, Milan