Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Tue, 10 Jun 2008 00:21:07 -0700 (PDT),    group: microsoft.public.platformsdk.security        back       


CryptSetProvParam error   
hi all, i am opening an handle to my smart card csp using
CryptAcquireContext and then trying to set the CSP pin using
CryptSetProvParam. But CryptSetProvParam return an NTE_FAIL error.

CryptAcquireContext(&hProv, NULL, "My CSP Name", PROV_RSA_FULL, 0));
CryptSetProvParam(hProv,PP_KEYEXCHANGE_PIN,(LPBYTE)"softex",0));

can anyone tell me what am i doing wrong?? I tried using the
CRYPT_VERIFYCONTEXT and the CRYPT_SILENT flag also with
CryptAcquireContext but still the same error come up.

thanks in advance
date: Tue, 10 Jun 2008 00:21:07 -0700 (PDT)   author:   Janma

RE: CryptSetProvParam error   
Hi,

The error NTE_FAIL is a very vague error code that means in general that the 
CSP has encountered an internal error. Since CryptSetProvParam with 
PP_KEYEXCHANGE_PIN is supposed to send an APDU command to the card, the error 
can come from the fact that APDU processing went wrong. You can trace the 
APDU exchanged between the CSP and the card using my free tool ScardSpy and 
see then if an error occurs. You can find it here: 
http://www.idrix.fr/Root/content/category/7/25/48/.
So, the error you are encountering is not linked to how you are calling the 
CSP but  it's due to the internal processing of the CSP and how it interacts 
with the smart card. If you are can't find any clues yourself, you'll have to 
contact your smart card vendor to get some help on how to diagnose your 
problem.

Cheers,
-- 
Mounir IDRASSI
IDRIX
http://www.idrix.fr

to reach : mounir_idrix_fr (replace the underscores with the at and dot 
characters respectively)


"Janma" wrote:

> hi all, i am opening an handle to my smart card csp using
> CryptAcquireContext and then trying to set the CSP pin using
> CryptSetProvParam. But CryptSetProvParam return an NTE_FAIL error.
> 
> CryptAcquireContext(&hProv, NULL, "My CSP Name", PROV_RSA_FULL, 0));
> CryptSetProvParam(hProv,PP_KEYEXCHANGE_PIN,(LPBYTE)"softex",0));
> 
> can anyone tell me what am i doing wrong?? I tried using the
> CRYPT_VERIFYCONTEXT and the CRYPT_SILENT flag also with
> CryptAcquireContext but still the same error come up.
> 
> thanks in advance
>
date: Tue, 10 Jun 2008 03:47:00 -0700   author:   Mounir IDRASSI am

RE: CryptSetProvParam error   
The error may also reflect the card's security: the card's CSP may not allow 
to set the PIN programmatically but only via its own prompt or even on the 
reader's keypad. (This could prevent a rogue program signing "behind the 
user's back" - at least in simple cases.)

Laszlo Elteto
SafeNet, Inc.

"Mounir IDRASSI" wrote:

> Hi,
> 
> The error NTE_FAIL is a very vague error code that means in general that the 
> CSP has encountered an internal error. Since CryptSetProvParam with 
> PP_KEYEXCHANGE_PIN is supposed to send an APDU command to the card, the error 
> can come from the fact that APDU processing went wrong. You can trace the 
> APDU exchanged between the CSP and the card using my free tool ScardSpy and 
> see then if an error occurs. You can find it here: 
> http://www.idrix.fr/Root/content/category/7/25/48/.
> So, the error you are encountering is not linked to how you are calling the 
> CSP but  it's due to the internal processing of the CSP and how it interacts 
> with the smart card. If you are can't find any clues yourself, you'll have to 
> contact your smart card vendor to get some help on how to diagnose your 
> problem.
> 
> Cheers,
> -- 
> Mounir IDRASSI
> IDRIX
> http://www.idrix.fr
> 
> to reach : mounir_idrix_fr (replace the underscores with the at and dot 
> characters respectively)
> 
> 
> "Janma" wrote:
> 
> > hi all, i am opening an handle to my smart card csp using
> > CryptAcquireContext and then trying to set the CSP pin using
> > CryptSetProvParam. But CryptSetProvParam return an NTE_FAIL error.
> > 
> > CryptAcquireContext(&hProv, NULL, "My CSP Name", PROV_RSA_FULL, 0));
> > CryptSetProvParam(hProv,PP_KEYEXCHANGE_PIN,(LPBYTE)"softex",0));
> > 
> > can anyone tell me what am i doing wrong?? I tried using the
> > CRYPT_VERIFYCONTEXT and the CRYPT_SILENT flag also with
> > CryptAcquireContext but still the same error come up.
> > 
> > thanks in advance
> >
date: Tue, 10 Jun 2008 08:39:00 -0700   author:   lelteto

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us