none
PIN dialog box does not appear RRS feed

  • Question

  • Dear all

    I develop some application which sign XML 

    everything OK but when I use certificate in usb token, PIN dialog appeared only once. After that, user does not required input PIN (I have closed application, remove usb token)

    I want that user have to input PIN each time to sign.

    ...

    X509Certificate2 card;

    X509Certificate2Collection chooseCert = X509Certificate2UI.SelectFromCollection(numberCerts,
                            "Certificates List ", "Choose your certificate", X509SelectionFlag.SingleSelection);

    card = chooseCert[0];

    System.Security.Cryptography.RSACryptoServiceProvider rsa;

    rsa = card.PrivateKey as RSACryptoServiceProvider;

    aSignature = rsa.SignData(sh, System.Security.Cryptography.CryptoConfig.MapNameToOID("SHA1"));

    ...

    thanks a lot

    Sunday, May 26, 2019 3:41 PM

All replies

  • Hi Nam,

    Thank for posting here.

    Based on your description, you want to show Pin dialog box when the user sign.

    I suggest that you change your code that could appear only once. You can set conditions for PIN dialog box.

    I only provide the advice because of the lack of usb token.

    Hope my advice could be helpful.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 27, 2019 8:42 AM
    Moderator