0

I am working on a minidriver project which can generate keypair in smartcard.

To generate a keypair from a test application I have to check if there is a keypair exist with the specified container name, if found I have to delete that.

To check if a container exist with the same name I have used NCryptOpenKey

Status = NCryptOpenKey(
hProvider,
&hKey,
wszContainerName,
0, // dwLegacyKeySpec
0 // dwFlags
);

It works perfectly and returns the key handle if there is a container available in smartcard with my minidriver.

But if there is no keypair with the same label in smart card it shows a dialog like this to select smart card

Select smartcard

Is it natural to show the card selection dialog?

How to stop showing the card selection dialog from minidriver? NCryptOpenKey can simply return SCARD_E_NO_KEY_CONTAINER (0x80100030)

iOS-Developer84
  • 654
  • 8
  • 19
  • 1
    Try setting flag NCRYPT_SILENT_FLAG – plstryagain Jun 22 '18 at 10:28
  • @plstryagain Thanks. My question was not fully described. The flag is the scope of test application. I want to know if there is any way to stop showing dialog from minidriver. Could you pls provide me any document/link which describes the inner functionality of NCryptOpenKey. – iOS-Developer84 Jun 22 '18 at 12:41
  • @iOS-Developer84 I dont actually understand, you call NCryptOpenKey from the driver, why not pass SILENT_FLAG in this driver, If you develop a driver that implements CSP interface, you should handle this flag in the OpenKey routine of this CSP – user2033775 Jan 15 '19 at 15:50

0 Answers0