Exclusive handle to a particular card that was introduced to the system by insertion into a card terminal slot. An application shall access smart cards only through instances of this or a derived class.

Namespace: CardWerk.SmartCard
Assembly: CardWerk.SmartCard (in CardWerk.SmartCard.dll)

Public NotInheritable Class CardHandle 
Implements IDisposable
This language is not supported or no code example is available.
public sealed class CardHandle : IDisposable
This language is not supported or no code example is available.
public ref class CardHandle sealed  : public IDisposable^
This language is not supported or no code example is available.
public final class CardHandle 
implements IDisposable
This language is not supported or no code example is available.
Name Description
Public property CLA The class byte to be used when sending generic ISO 7816-4 command APDUs to the card.
Public property IsInvalid Indicates whether the presented and connected card was unexpectedly removed by the user. If this flag is true, then it is no longer possible to send any commands to the card, even if a card is re-inserted into the card terminal slot.
Public property Slot The slot where the card was inserted.
Top
Name Description
Public method ChangePin(CardPinControl, string, string) Performs PIN verify and PIN change.
Public method Disconnect() Disconnects the card and releases the card terminal slot.
Public method Dispose() Each instance of this class must be orderly disposed by invoking the IDispose.Dispose method when the handle to the card is no longer needed.
Public method GetATR() Returns the ATR of the card that this CardHandle controls.
Public method GetHistoricalBytes() Returns the Historical Bytes of the ATR of the card.
Public method ReadBinary(byte, byte, byte) Generic ISO 7816-4 command for reading data from a elementary file (EF) with transparent structure. The EF will be implicitly selected through a short file identifier (SFI).
Public method ReadBinary(int, byte) Generic ISO 7816-4 command for reading data from the currently selected elementary file with transparent structure.
Public method ReadRecord(byte, byte) Generic ISO 7816-4 command for reading a record from the currently selected elementary file with record structure.
Public method Reset() Fully reset the inserted card. This can be useful in order to recover from communication failures or card errors.
Public method SelectApplication(byte[]) Simplifies the selection of a card application.
Public method SelectDirectory(int) Generic ISO 7816-4 command for selecting a dedicated file DF.
Public method SelectFile(int) Generic ISO 7816-4 command for selecting an elementary file EF.
Public method SelectRoot() Generic ISO 7816-4 command for selecting the master file (MF).
Public method SendCommand(CardCommandAPDU) Sends the command APDU to the card or reader represented by this card handle and returns its response APDU.
Public method UpdateBinary(int, byte[]) Generic ISO 7816-4 command for updating data in the currently selected elementary file with transparent structure.
Public method UpdateRecord(byte, byte[]) Generic ISO 7816-4 command for updating data in the currently selected elementary file with record structure.
Public method VerifyPin(CardPinControl, string) Performs a PIN verification.
Public method VerifyPin(CardPinControl) Performs a PIN verification using secure PIN entry (SPE) capability of the card terminal.
Public method WriteBinary(int, byte[]) Generic ISO 7816-4 command for writing data to the currently selected elementary file with transparent structure.
Top
An instance of the CardHandle class can only be created in response to the insertion of a smart card into a card terminal slot. Subsequently a card handle remains tied to the card terminal slot where the card was originally inserted. If that card is removed, the card handle becomes invalid (see IsInvalid) and remains invalid, even if the card is re-inserted again. To handle another card insertion, even if it is actually the same card, a new instance of this class is required.

.NET Framework

Supported in: 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

.NET Core

Supported in: 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0

.NET Standard

Supported in: 2.0