How to stop showing smartcard selection dialog in NCryptOpenKey from minidriver if key container not available

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)

c++
cryptography
smartcard
cryptoapi
cng
asked on Stack Overflow Jun 22, 2018 by iOS-Developer84 • edited Jun 22, 2018 by iOS-Developer84

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0