How do I ensure that the contents of a new card in the card reader is updated correctly? I use both <TElPKCS11CertStorage>.RefreshCertificateContexts and <TElPKCS11CertStorage>.Module.Slot[<index>].Refresh, but I still get contents from the previous card in e g <TElX509Certificate>.SubjectRDN.

There is no way to, literally, 'update' the contents of the card. Whenever you switch a card in the card reader, it should be viewed as a sequence of two independent actions:

1. Old card removed. The session and all the related objects become invalid.

2. New card inserted. New session should be opened to access the card.

To deal with this, you should subscribe to OnSlotEvent event. Once you catch the event, please call the provided slot object's Refresh() method to obtain the updated token information. Then open the new session and log into it as usual.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.