[xmlsec] Pin Caching

2006-10-09 Thread Jürgen Heiss



Hi,
 
I'm using a 
ReinerSct Card Reader to sign my files. This Card reader use PinCaching. 

This means if I want 
to sign 3 files I only need to type in the PinCount and the PIN one time on 
the CardReader.
 
do 

{
 if(xmlSecDSigCtxInitialize(&dsigCtx, gKeysMngr) < 0) 
   {fprintf(stderr, "Error: dsig 
context initialization 
failed\n");return(-1);   }
 
   if(xmlSecAppPrepareDSigCtx(&dsigCtx) < 0) 
   {fprintf(stderr, "Error: dsig 
context preparation failed\n");goto 
done;   }
 
  /* parse template and select start node 
*/   data = "" 
xmlSecNodeSignature, xmlSecDSigNs);   if(data == NULL) 
   {fprintf(stderr, "Error: 
failed to load template \"%s\"\n", filename);goto 
done;   }  /* sign 
*/   start_time = 
clock();   if(xmlSecDSigCtxSign(&dsigCtx, 
data->startNode) < 0) 
   {fprintf(stderr,"Error: 
signature failed \n");goto 
done;   }
 
...
...
}
 
But every time when 
I call xmlSecDSigCtxSign I have to tell the Pin again to the card 
reader.
I think this is 
because xmlSecDSigCtxSign Opens the MsCrypto Sign the file and close MsCrypto 
again.
 
Does anyone have 
some ideas?
 
Thanks
 
___
xmlsec mailing list
xmlsec@aleksey.com
http://www.aleksey.com/mailman/listinfo/xmlsec


Re: [xmlsec] Pin Caching

2006-10-09 Thread Wouter




It might depend on the way your signing key is selected. Now it is done
via the template, and therefore probably each time reselected and
reloaded from MS certificate store (and thus from your card), could you
try to load the key inside the application itself and keep it during
the three signatures? Does that make any difference?

Wouter

Jürgen Heiss wrote:

  
  
  Hi,
   
  I'm
using a ReinerSct Card Reader to sign my files. This Card reader use
PinCaching. 
  This
means if I want to sign 3 files I only need to type in the PinCount and
the PIN one time on the CardReader.
   
  do 
  {
   if(xmlSecDSigCtxInitialize(&dsigCtx,
gKeysMngr) < 0) 
   {
fprintf(stderr, "Error: dsig context initialization failed\n");
return(-1);
   }
   
     if(xmlSecAppPrepareDSigCtx(&dsigCtx)
< 0) 
   {
fprintf(stderr, "Error: dsig context preparation failed\n");
goto done;
   }
   
   
/* parse template and select start node */
   data = "" xmlSecNodeSignature,
xmlSecDSigNs);
   if(data == NULL) 
   {
fprintf(stderr, "Error: failed to load template \"%s\"\n",
filename);
goto done;
   }
  /* sign */
   start_time = clock();
   if(xmlSecDSigCtxSign(&dsigCtx, data->startNode) < 0) 
   {
fprintf(stderr,"Error: signature failed \n");
goto done;
   }
   
  ...
  ...
  }
   
  But
every time when I call xmlSecDSigCtxSign I have to tell the Pin again
to the card reader.
  I
think this is because xmlSecDSigCtxSign Opens the MsCrypto Sign the
file and close MsCrypto again.
   
  Does
anyone have some ideas?
   
  Thanks
   
  

___
xmlsec mailing list
xmlsec@aleksey.com
http://www.aleksey.com/mailman/listinfo/xmlsec
  




___
xmlsec mailing list
xmlsec@aleksey.com
http://www.aleksey.com/mailman/listinfo/xmlsec