PCSC Creates a new instance The application context to the PC/SC Resource Manager that will be used for and Dispose this instance true if the user called otherwise false if called from GC finalizer. Creates a instance A connected card/reader handle Creates a instance A connected card/reader handle If set to true, the reader will destroy the on Dispose this instance If true, all managed resources will be disposed. Smart card context factory Default factory instance. Create and establish a new smart card context. Scope of the establishment. This can either be a local or remote connection. A new established smart card context A communication error occurred. Creates a new instance. Error number. Creates a new instance. System's error code Error message Creates a new instance. System's error code Error message Inner exception. Serialization constructor A supplied buffer is insufficient. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor An internal error occurred. Creates a new instance. System's error code Creates a new instance. System's error code Error message Creates a new instance. System's error code Error message Inner exception Serialization constructor Invalid PC/SC context exception. Creates a new instance. System's error code Creates a new instance. System's error code Error message Creates a new instance. System's error code Error message Inner exception Serialization constructor One or more arguments contain invalid parameters. Creates a new instance. System's error code Creates a new instance. System's error code Error message Creates a new instance. System's error code Error message Inner exception Serialization constructor An invalid protocol has been requested. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor Invalid PC/SC scope exception. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The share mode is invalid. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor One or more arguments contain invalid values. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The group does not contain any reader Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The PC/SC service is not running. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor No smart card is currently inserted. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The reader or the smart card is not ready. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor A general PC/SC exception. Serialization name for property The system's error code. Creates a new instance. System's error code Creates a new instance. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor Gets data for serialization The requested reader is unavailable. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor A smart card has been removed. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor A sharing violation occurred. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor Operation exited successfully Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The requested reader name is unknown. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The smart card is unpowered. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The smart card is unresponsive. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor The requested feature is unsupported. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor A supplied buffer is insufficient. Initializes a new instance of the class. System's error code Initializes a new instance of the class. System's error code An error message text. Initializes a new instance of the class. System's error code An error message text. The inner exception. Serialization constructor CardError extensions methods Throws an exception if is not . error code to check Throws a specific exception error code to check Extension methods for Checks if a card is absent State to check true if the card is absent Checks if a card is present State to check true if a card is present Encapsulates a handle to a connected card / or a directly connected reader The card handle The connected reader's friendly name. A human readable string of the reader name or if the reader object is currently not connected. The current mode of connection type: exclusive, shared or direct. The currently used protocol to communicate with the card. if not connected. The current connection state of the reader. if the reader is connected. Otherwise . Establishes a connection to the Smart Card reader. Reader name to connect to. Mode of connection type: exclusive or shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Desired protocol use. is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. This method calls the API function SCardConnect(). Terminates a connection made through . Reader function to execute. This method calls the API function SCardDisconnect(). Reestablishes a connection to a reader that was previously connected to using . Mode of connection type: exclusive/shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Desired protocol use. Desired action taken on the card/reader before reconnect. is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. The protocol used with this connection will be stored in . This method calls the API function SCardReconnect(). A reader class that implements the most basic PC/SC functions to operate on smart cards, RFID tags and so on. The connected reader's friendly name. A human readable string of the reader name. The current mode of connection type: exclusive, shared or direct. The currently used protocol to communicate with the card. Card or reader handle. can be used for C API calls Connection state of the reader. if the reader is connected. Otherwise . Reestablishes a connection to a reader that was previously connected to using . Mode of connection type: exclusive/shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Direct connection to the reader. (SCARD_SHARE_DIRECT) Desired protocol use. Desired action taken on the card/reader before reconnect. is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. The protocol used with this connection will be stored in . This method calls the API function SCardReconnect(). Establishes a temporary exclusive access mode for doing a serie of commands in a transaction. Action to be taken on the reader if the user ends the transaction. You might want to use this when you are selecting a few files and then writing a large file so you can make sure that another application will not change the current file. If another application has a lock on this reader or this application is in there will be no action taken. This method calls the API function SCardBeginTransaction(). SCardEndTransaction() will be called when you dispose the returned value An anonymous instance implementing that must be disposed to end the transaction. Sends an APDU to the smart card. APDU to send to the card. Response from the card. This method will only work if the reader has been connected with one of the following protocols: ProtocolDescription T=0 active protocol. T=1 active protocol. Raw active protocol. The number of bytes written to the Sends an APDU to the smart card. A pointer to the protocol header structure for the instruction. This buffer is in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI). You can use one of the following: Protocol Control Information Description Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. Response from the card. The number of bytes written to the Sends an APDU to the smart card. Protocol Control Information in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI) APDU to send to the card. Response from the card. The number of bytes written to the Sends an APDU to the smart card. A pointer to the protocol header structure for the instruction. This buffer is in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI). You can use one of the following: Protocol Control Information Description Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. The buffer size of in bytes. Pointer to the protocol header structure for the instruction, followed by a buffer in which to receive any returned protocol control information (PCI) specific to the protocol in use. This parameter can be NULL if no PCI is returned. Response from the card. The buffer size of in bytes. The number of bytes written to the Sends an APDU to the smart card. A pointer to the protocol header structure for the instruction. This buffer is in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI). You can use one of the following: Protocol Control Information Description Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. The buffer size of in bytes. Response from the card. The buffer size of in bytes. The number of bytes written to the Sends an APDU to the smart card. A pointer to the protocol header structure for the instruction. This buffer is in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI). You can use one of the following: Protocol Control Information Description Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. The buffer size of in bytes. Structure of Protocol Header Information followed by a buffer in which to receive any returned protocol control information (PCI) specific to the protocol in use. This parameter can be null if no PCI is returned. Response from the card. The buffer size of in bytes. The number of bytes written to the Sends an APDU to the smart card. Protocol Control Information in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI) APDU to send to the card. The buffer size of in bytes. Structure of Protocol Header Information followed by a buffer in which to receive any returned protocol control information (PCI) specific to the protocol in use. This parameter can be null if no PCI is returned. Response from the card. The buffer size of in bytes. The number of bytes written to the Sends an APDU to the smart card. Protocol Control Information in the format of an SCARD_IO_REQUEST structure, followed by the specific protocol control information (PCI) APDU to send to the card. The buffer size of in bytes. Response from the card. The buffer size of in bytes. The number of bytes written to the Sends a command directly to the IFD Handler (reader driver) to be processed by the reader. Control code for the operation. Command to send to the reader. size Response from the reader. size This method is useful for creating client side reader drivers for functions like PIN pads, biometrics, or other extensions to the normal smart card reader that are not normally handled by PC/SC. This method calls the API function SCardControl(). The number of bytes written to the Sends a command directly to the IFD Handler (reader driver) to be processed by the reader. Control code for the operation. Command to send to the reader. Response from the reader. This method is useful for creating client side reader drivers for functions like PIN pads, biometrics, or other extensions to the normal smart card reader that are not normally handled by PC/SC. This method calls the API function SCardControl(). The number of bytes written to the Returns the current status of the reader and the connected card. A reader status instance Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. size. This method calls the API function SCardGetAttrib(). The number of bytes written to the attributebuffer OR the required buffer size if is null. Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. This method calls the API function SCardGetAttrib(). The number of bytes written to the attributebuffer OR the required buffer size if is null. Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. size. This method calls the API function SCardGetAttrib(). The number of bytes written to the attributebuffer OR the required buffer size if is null. Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. This method calls the API function SCardGetAttrib(). The number of bytes written to the attributebuffer OR the required buffer size if is null. Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. This method calls the API function SCardGetAttrib(). The attribute bytes Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. This method calls the API function SCardGetAttrib(). The attribute bytes Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. Length of the buffer in bytes. The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. Length of the buffer in bytes. The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Terminates a connection and invalidates the card handle." />. Reader function to execute. This method calls the API function SCardDisconnect(). You cannot Reconnect after calling this method. Smart card context factory Create and establish a new smart card context. Scope of the establishment. This can either be a local or remote connection. A new established smart card context Gives access to the system's smart card API PC/SC API for Linux (x86/x64) PC/SC API for MacOS X Platform selector (Windows or UNIX) Returns true if the operation system runs on Windows. false otherwise. Platform smart card library. State of the smart card in the reader. Is a bit mask that represents the current reader status. Unknown status. There is no card in the reader. There is a card in the reader, but it has not been moved into position for use. There is a card in the reader in position for use. The card is not powered. Power is being provided to the card, but the reader driver is unaware of the mode of the card. The card has been reset and is awaiting PTS negotiation. The card has been reset and specific communication protocols have been established. PC/SC API for Microsoft Win32/Win64 (x86/x64/IA64) An application context to the PC/SC Resource Manager. Each thread of an application shall use its own context. A pointer (Application Context) that can be used for C API calls. The returned Application Context handle. Is if not context has been established. This is the Application Context handle that is returned when calling the C API function SCardEstablishContext(). Maximum ATR size. PlatformMaximum ATR size Windows (Winscard.dll) 36 UNIX/Linux (PC/SClite) 33 Attention: Size depends on platform. Infinite timeout. 0xFFFFFFFF Creates an Application Context to the PC/SC Resource Manager. Scope of the establishment. This can either be a local or remote connection. Creates an Application Context for a client. This must be the first WinSCard function called in a PC/SC application. Each thread of an application shall use its own . This method calls the API function SCardEstablishContext(). Destroys a communication context to the PC/SC Resource Manager and frees unmanaged resources. This must be the last method called in a PC/SC application. calls this method silently. This method calls the API function SCardReleaseContext(). Checks the validity of the current context. Return value Description The context is valid. (SCARD_S_SUCCESS) The context is invalid. (SCARD_E_INVALID_HANDLE) Call this function to determine whether a smart card context handle is still valid. After a smart card context handle has been set by , it may become not valid if the resource manager service has been shut down. This method calls the API function SCardIsValidContext(). Checks the validity of the current context. if the context is valid. Call this function to determine whether a smart card context handle is still valid. After a smart card context handle has been set by , it may become not valid if the resource manager service has been shut down. Returns a list of currently available readers. List of groups to list readers. An array of s containing all Smart Card readers found by the PC/SC Resource Manager. Groups are not used on Linux/UNIX machines using the PC/SC Lite daemon. This method calls the API function SCardListReaders(). Returns a list of currently available readers. An array of s containing all Smart Card readers found by the PC/SC Resource Manager. This method calls the API function SCardListReaders(). Returns a list of currently available reader groups. An array of s containing all Smart Card reader groups found by the PC/SC Resource Manager. This method calls the API function SCardListReaderGroups(). Establishes a connection to the Smart Card reader and returns a handle Reader name to connect to. Mode of connection type: exclusive or shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Direct connection to the reader. (SCARD_SHARE_DIRECT) Desired protocol use. is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. This method calls the API function SCardConnect(). A handle to the smartcard or reader Establishes a connection to the Smart Card reader and returns a reader instance Reader name to connect to. Mode of connection type: exclusive or shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Direct connection to the reader. (SCARD_SHARE_DIRECT) Desired protocol use. is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. This method calls the API function SCardConnect(). A reader instance Returns the current reader status. The requested reader. A that contains the current reader status. This method uses the method with a timeout of zero. Returns the current reader status of all requested readers. Requested reader names. An array of s that contains the current reader status of each requested reader. This method uses the method with a timeout of zero. Blocks execution until the current availability of the cards in a specific set of readers changes. Maximum waiting time (in milliseconds) for status change, zero or for infinite. Structures of readers with current states. A indicating an error or the success.The caller receives status changes through the array. Return value Description Successful (SCARD_S_SUCCESS) Server is not running (SCARD_E_NO_SERVICE) is invalid or (SCARD_E_INVALID_PARAMETER) Invalid States, reader name, etc (SCARD_E_INVALID_VALUE) Invalid context (SCARD_E_INVALID_HANDLE) The reader is unavailable (SCARD_E_READER_UNAVAILABLE) The user-specified timeout value has expired (SCARD_E_TIMEOUT) This method receives a structure or list of structures containing reader names. It then blocks for a change in state to occur for a maximum blocking time of or forever if is used. The new event state will be contained in . A status change might be a card insertion or removal event, a change in ATR, etc. To wait for a reader event (reader added or removed) you may use the special reader name "\\?PnP?\Notification". If a reader event occurs the state of this reader will change and the bit will be set. This method calls the API function SCardGetStatusChange(). Cancels all pending blocking requests on the method. Return valueDescription Successful (SCARD_S_SUCCESS) Invalid context (SCARD_E_INVALID_HANDLE) Server is not running (SCARD_E_NO_SERVICE) An internal communications error has been detected (SCARD_F_COMM_ERROR) This method calls the API function SCardCancel(). Common functions that are needed to operate on Smart Card readers. See . Establishes a connection to the Smart Card reader. Reader name to connect to. Mode of connection type: exclusive or shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Desired protocol use. An error code / return value: Error codeDescription Successful (SCARD_S_SUCCESS) Invalid context handle (SCARD_E_INVALID_HANDLE) is invalid or (SCARD_E_INVALID_PARAMETER) Invalid sharing mode, requested protocol, or reader name (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) No smart card present (SCARD_E_NO_SMARTCARD) Could not allocate the desired port (SCARD_E_NOT_READY) Requested protocol is unknown (SCARD_E_PROTO_MISMATCH) Could not power up the reader or card (SCARD_E_READER_UNAVAILABLE) Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION) The reader name is (SCARD_E_UNKNOWN_READER) Protocol not supported (SCARD_E_UNSUPPORTED_FEATURE) An internal communications error has been detected (SCARD_F_COMM_ERROR) An internal consistency check failed (SCARD_F_INTERNAL_ERROR) Card is not powered (SCARD_W_UNPOWERED_CARD) Card is mute (SCARD_W_UNRESPONSIVE_CARD) is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. The protocol used with this connection will be stored in . This method calls the API function SCardConnect(). Terminates a connection made through . Reader function to execute. Return value Description Successful (SCARD_S_SUCCESS) Invalid card handle (SCARD_E_INVALID_HANDLE) Invalid (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) No smart card present (SCARD_E_NO_SMARTCARD) An internal communications error has been detected (SCARD_F_COMM_ERROR) This method calls the API function SCardDisconnect(). Reestablishes a connection to a reader that was previously connected to using . Mode of connection type: exclusive/shared. ValueDescription This application will allow others to share the reader. (SCARD_SHARE_SHARED) This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) Desired protocol use. Desired action taken on the card/reader before reconnect. An error code / return value: Error codeDescription Successful (SCARD_S_SUCCESS) Invalid context handle (SCARD_E_INVALID_HANDLE) is invalid or (SCARD_E_INVALID_PARAMETER) Invalid sharing mode, requested protocol, or reader name (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) No smart card present (SCARD_E_NO_SMARTCARD) Could not allocate the desired port (SCARD_E_NOT_READY) Requested protocol is unknown (SCARD_E_PROTO_MISMATCH) Could not power up the reader or card (SCARD_E_READER_UNAVAILABLE) Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION) Protocol not supported (SCARD_E_UNSUPPORTED_FEATURE) An internal communications error has been detected (SCARD_F_COMM_ERROR) An internal consistency check failed (SCARD_F_INTERNAL_ERROR) The smart card has been removed (SCARD_W_REMOVED_CARD) Card is mute (SCARD_W_UNRESPONSIVE_CARD) is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. The protocol used with this connection will be stored in . This method calls the API function SCardReconnect(). Establishes a temporary exclusive access mode for doing a serie of commands in a transaction. Return value Description Successful (SCARD_S_SUCCESS) Invalid card handle (SCARD_E_INVALID_HANDLE) The server is not runing (SCARD_E_NO_SERVICE) The reader has been removed (SCARD_E_READER_UNAVAILABLE) Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION) An internal communications error has been detected (SCARD_F_COMM_ERROR) You might want to use this when you are selecting a few files and then writing a large file so you can make sure that another application will not change the current file. If another application has a lock on this reader or this application is in there will be no action taken. This method calls the API function SCardBeginTransaction(). Ends a previously begun transaction. Action to be taken on the reader. Return value Description Successful (SCARD_S_SUCCESS) Invalid card handle (SCARD_E_INVALID_HANDLE) Invalid value for (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) The reader has been removed (SCARD_E_READER_UNAVAILABLE) Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION) An internal communications error has been detected (SCARD_F_COMM_ERROR) The calling application must be the owner of the previously begun transaction or an error will occur. This method calls the API function SCardEndTransaction(). The disposition action is not currently used in PC/SC Lite on UNIX/Linux machines. Sends an APDU to the smart card that was previously connected by . A pointer to a pre-defined Structure of Protocol Control Information. You can use one of the following: Protocol Control InformationDescriptionPre-defined T=0 PCI structure. (SCARD_PCI_T0)Pre-defined T=1 PCI structure. (SCARD_PCI_T1)Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. The buffer size of in bytes. Structure of protocol information. Response from the card. The buffer size of in bytes. Return value Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . The size of the returned data will be stored in . This method will return with error code if the buffer size of is too small for the result. If one of the parameters or is invalid, the method will throw an . This method calls the API function SCardTransmit(). The pointers to the pre-defined / built-in PCI structures are determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Sends an APDU to the smart card that was previously connected by . A pointer to a pre-defined Structure of Protocol Control Information. You can use one of the following: Protocol Control InformationDescriptionPre-defined T=0 PCI structure. (SCARD_PCI_T0)Pre-defined T=1 PCI structure. (SCARD_PCI_T1)Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. Structure of protocol information. Response from the card. Return value Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . is a structure containing the following (implemented in ) Sends an APDU to the smart card that was previously connected by . A pointer to a pre-defined Structure of Protocol Control Information. You can use one of the following: Protocol Control InformationDescription Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) APDU to send to the card. Response from the card. Return value Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . This method calls the API function SCardTransmit(). The pointers to the pre-defined / built-in PCI structures are determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Sends an APDU to the smart card that was previously connected by . Structure of Protocol Control Information. APDU to send to the card. Structure of protocol information. Response from the card. Return value Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . and are structures containing the following (implemented in ): typedef struct { DWORD dwProtocol; // SCARD_PROTOCOL_T0 or SCARD_PROTOCOL_T1 DWORD cbPciLength; // Length of this structure - not used } SCARD_IO_REQUEST; It is recommended to use pre-defined / built-in PCI structures by calling one of the following methods: This method calls the API function SCardTransmit(). The pointers to the pre-defined / built-in PCI structures are determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Sends an APDU to the smart card that was previously connected by . APDU to send to the card. The buffer size of in bytes. Response from the card. The buffer size of in bytes. Return value Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . The buffer must be initialized. The size of the returned data will be stored in . This method will return with error code if the buffer size of is too small for the result. If one of the parameters or is invalid, the method will throw an . This method calls the API function SCardTransmit(). This method will only work if the reader has been connected with one of the following protocols: ProtocolDescription T=0 active protocol. T=1 active protocol. Raw active protocol. Sends an APDU to the smart card that was previously connected by . APDU to send to the card. Response from the card. The buffer size of in bytes. Return value Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . The buffer must be initialized. The size of the returned data will be stored in . This method will return with error code if the buffer size of is too small for the result. If the parameter is invalid, the method will throw an . This method calls the API function SCardTransmit(). This method will only work if the reader has been connected with one of the following protocols: ProtocolDescriptionT=0 active protocol.T=1 active protocol.Raw active protocol. Sends an APDU to the smart card that was previously connected by . APDU to send to the card. Response from the card. Return valueDescription Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) or is (SCARD_E_INVALID_PARAMETER) Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) APDU exchange not successful (SCARD_E_NOT_TRANSACTED) Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been reset by another application (SCARD_W_RESET_CARD) The card has been removed from the reader (SCARD_W_REMOVED_CARD) The card responds from the APDU and stores this response in . The buffer must be initialized and will be resized, if the buffer was too big. This method calls the API function SCardTransmit(). This method will only work if the reader has been connected with one of the following protocols: ProtocolDescription T=0 active protocol. T=1 active protocol. Raw active protocol. Sends a command directly to the IFD Handler (reader driver) to be processed by the reader. Control code for the operation. Command to send to the reader. Response from the reader. Return code Description Successful (SCARD_S_SUCCESS) or are too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) is and the IFDHandler is version 2.0 (without ) (SCARD_E_INVALID_PARAMETER) Invalid value was presented (SCARD_E_INVALID_VALUE) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed(SCARD_E_READER_UNAVAILABLE) Driver does not support (SCARD_E_UNSUPPORTED_FEATURE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The card has been removed from the reader(SCARD_W_REMOVED_CARD) The card has been reset by another application (SCARD_W_RESET_CARD) This method is useful for creating client side reader drivers for functions like PIN pads, biometrics, or other extensions to the normal smart card reader that are not normally handled by PC/SC. This method calls the API function SCardControl(). The API of this function changed. In pcsc-lite 1.2.0 and before the API was not Windows(R) PC/SC compatible. This has been corrected. Returns the current status of the reader and the connected card. The connected readers's friendly name. The current state. The card's currently used protocol. The card's ATR. Return value Description Successful (SCARD_S_SUCCESS) The reader object did not allocate enough memory for or for (SCARD_E_INSUFFICIENT_BUFFER) The reader object got invalid. Invalid card handle (SCARD_E_INVALID_HANDLE) The reader object passed a size of null for or (SCARD_E_INVALID_PARAMETER) Memory allocation failed (SCARD_E_NO_MEMORY) The server is not runing (SCARD_E_NO_SERVICE) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) An internal consistency check failed (SCARD_F_INTERNAL_ERROR) The smart card has been removed (SCARD_W_REMOVED_CARD) The smart card has been reset (SCARD_W_RESET_CARD) The connected readers's friendly name will be stored in . The card's ATR will be stored in . The current state, and protocol will be stored in and respectively. This method calls the API function SCardStatus(). Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. Size of the result contained in attribute (in bytes). Return code Description Successful (SCARD_S_SUCCESS) is too big - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Reader buffer not large enough - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) Memory allocation failed (SCARD_E_NO_MEMORY) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The method will return if is or if the buffer size is not sufficient. contains the required amount of bytes (size). If the method returned with then contains the exact size of the result in . For an example please see . This method calls the API function SCardGetAttrib(). Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. Return code Description Successful (SCARD_S_SUCCESS) is too big - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Reader buffer not large enough - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) Memory allocation failed (SCARD_E_NO_MEMORY) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) This method calls the API function SCardGetAttrib(). Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. Size of the result contained in attribute (in bytes). Return code Description Successful (SCARD_S_SUCCESS) is too big - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Reader buffer not large enough - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) Memory allocation failed (SCARD_E_NO_MEMORY) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The method will return if is or if the buffer size is not sufficient. contains the required amount of bytes (size). If the method returned with then contains the exact size of the result in . For an example please see . This method calls the API function SCardGetAttrib(). Gets an attribute from the IFD Handler (reader driver). Identifier for the attribute to get. A buffer that receives the attribute. Return code Description Successful (SCARD_S_SUCCESS) is too big - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Reader buffer not large enough - indicates an error in the PC/SC class library. (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) Memory allocation failed (SCARD_E_NO_MEMORY) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) This method calls the API function SCardGetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. Length of the buffer in bytes. Column Description Successful (SCARD_S_SUCCESS) attribute is too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. Column Description Successful (SCARD_S_SUCCESS) attribute is too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. Length of the buffer in bytes. Column Description Successful (SCARD_S_SUCCESS) attribute is too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). Set an attribute of the IFD Handler. Identifier for the attribute to set. Buffer that contains the new value of the attribute. Value Description Successful (SCARD_S_SUCCESS) attribute is too big (SCARD_E_INSUFFICIENT_BUFFER) Invalid card handle (SCARD_E_INVALID_HANDLE) A parameter is and should not (SCARD_E_INVALID_PARAMETER) The server is not runing (SCARD_E_NO_SERVICE) Data exchange not successful (SCARD_E_NOT_TRANSACTED) The reader has been removed (SCARD_E_READER_UNAVAILABLE) An internal communications error has been detected (SCARD_F_COMM_ERROR) The list of attributes you can set depends on the IFD handler you are using. This method calls the API function SCardSetAttrib(). The connected reader's friendly name. A human readable string of the reader name or if the reader object is currently not connected. The Smart Card context that will be used for this connection. if the reader is not connected. The current mode of connection type: exclusive or shared. The currently used protocol to communicate with the card. if not connected. A pointer (Card Handle) that can be used for C API calls. 0 if not connected. This is the card handle that is returned when calling the C API function SCardConnect(). The current connection state of the reader. if the reader is connected. Otherwise . Smart card event. Name of the reader that has raised the event. A human readable string of the reader name. The card's ATR (if present), otherwise null. Creates a new instance. Creates a new instance. Name of the reader that has raised the event. The card's ATR (if present), otherwise null. The reader has been Initialized. The sender object. Reader status information. // Create a monitor object with its own PC/SC context. SCardMonitor monitor = new SCardMonitor( new SCardContext(), SCardScope.System); // Point the callback function(s) to the pre-defined method MyCardInitializedMethod. monitor.Initialized += new CardInitializedEvent(MyCardInitializedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); A new card has been inserted. The sender object Reader status information. // Create a monitor object with its own PC/SC context. SCardMonitor monitor = new SCardMonitor( new SCardContext(), SCardScope.System); // Point the callback function(s) to the pre-defined method MyCardInsertedMethod. monitor.CardInserted += new CardInsertedEvent(MyCardInsertedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); A card has been removed. The sender object. Reader status information. // Create a monitor object with its own PC/SC context. SCardMonitor monitor = new SCardMonitor( new SCardContext(), SCardScope.System); // Point the callback function(s) to the pre-defined method MyCardRemovedMethod. monitor.CardRemoved += new CardRemovedEvent(MyCardRemovedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); Information about a smart card reader status. The current reader status. Is a bit mask containing one or more of the following values: State Description The application is unaware of the current state, and would like to know. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero. This reader should be ignored There is a difference between the state believed by the application, and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader. The given reader name is not recognized by the resource manager. If this bit is set, then and will also be set The actual state of this reader is not available. If this bit is set, then all the following bits are clear. There is no card in the reader. If this bit is set, all the following bits will be clear There is a card in the reader The card in the reader is allocated for exclusive use by another application. If this bit is set, will also be set. The card in the reader is in use by one or more other applications, but may be connected to in shared mode. If this bit is set, will also be set. There is an unresponsive card in the reader. Creates a new instance. Creates a new instance. Name of the smard card reader The reader's state The card's ATR. A smartcard device status change The sender object. Reader device changes. Information about attached and detached smart card reader devices. All connected smartcard reader devices Recently attached (added) smartcard reader devices Recently detached (removed) smartcard reader devices Creates a new instance All connected smartcard reader devices Attached/added smartcard reader devices Detached/removed smartcard reader devices Monitors for attached and detached smartcard reader devices. The monitor object has been initialized. New reader(s) have been attached and/or detached. An PC/SC error occurred during monitoring. Creates a new instance Creates a new instance Context factory used for this monitor Scope of the establishment. This can either be a local or remote connection. Finalizer Starts monitoring for device status changes Cancels the monitoring. This will end the monitoring. The method calls the method of its Application Context to the PC/SC Resource Manager. Disposes the object. Dispose will call in order to stop the background thread. The application context will be disposed if you configured the monitor to do so at construction time. An PC/SC error occurred during device monitoring. The sender object. Argument that contains the exception. Information about a device monitor exception Exception that occurred in device monitor thread Creates an instance Exception that occurred in monitoring thread Smartcard reader device monitoring factory Default factory instance. Uses for context creation. Creates a monitor instance Context factory to use Monitors for attached and detached smartcard reader devices. The monitor object has been initialized. New reader(s) have been attached and/or detached. An PC/SC error occurred during monitoring. Starts monitoring for device status changes Cancels the monitoring. This will end the monitoring. The method calls the method of its Application Context to the PC/SC Resource Manager. Smartcard reader device monitoring factory Creates a device monitor Scope of the establishment. This can either be a local or remote connection. A Releases the smartcard device monitor and its dependencies using the method. Smartcard device monitor that shall be stopped and disposed. Smart card monitor factory Creates a smart card event monitor Scope of the establishment. This can either be a local or remote connection. A Releases the smart card monitor and its dependencies using the method. Smart card monitor that shall be stopped and disposed. Monitors a Smart Card reader and triggers events on status changes. A general reader status change. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); // Point the callback function(s) to the pre-defined method MyStatusChangedMethod. monitor.StatusChanged += new StatusChangeEvent(MyStatusChangedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); A new card has been inserted. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.CardInserted += new CardInsertedEvent(MyCardInsertedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); A card has been removed. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.CardRemoved += new CardRemovedEvent(MyCardRemovedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); The monitor object has been initialized. This event appears only once for each reader after calling or . // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.Initialized += new CardInitializedEvent(MyCardInitializedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); An PC/SC error occurred during monitoring. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.MonitorException += new MonitorExceptionEvent(MyMonitorExceptionMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); All readers that are currently being monitored. A array of reader names. if no readers is being monitored. Indicates if there are readers currently monitored. Value Description Monitoring process ongoing. No monitoring. The number of readers that currently being monitored. Return 0 if no reader is being monitored. Returns the current state of a reader that is currently being monitored. The number of the desired reader. The index must be between 0 and ( - 1). The current state of reader with index number . This method will throw an if the specified is invalid. You can enumerate all readers currently monitored with the property. If the specified is invalid. Returns the current state of a reader that is currently being monitored. The number of the desired reader. The index must be between 0 and ( - 1). The current state of reader with index number . This method will throw an if the specified is invalid. You can enumerate all readers currently monitored with the property. If the specified is invalid. Returns the reader name of a given . The number of the desired reader. The index must be between 0 and ( - 1). A reader name. This method will throw an if the specified is invalid. You can enumerate all readers currently monitored with the property. If the specified is invalid. Cancels the monitoring of all readers that are currently being monitored. This will end the monitoring. The method calls the method of its Application Context to the PC/SC Resource Manager. The Smart Card reader that shall be monitored. Starts to monitor a single Smart Card reader for status changes. // Create a new monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); // Start to monitor a single reader. monitor.Start("OMNIKEY CardMan 5x21 00 00"); Do not forget to register for at least one event: EventDescription A new card has been inserted. A card has been removed. Initial status. A general status change. An error occurred. A array of reader names that shall be monitored. Starts to monitor a range Smart Card readers for status changes. string [] readerNames; using (var ctx = new SCardContext()) { ctx.Establish(SCardScope.System); // Retrieve the names of all installed readers. readerNames = ctx.GetReaders(); ctx.Release(); } // Create a new monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); foreach (string reader in readerNames) { Console.WriteLine("Start monitoring for reader {0}.", reader); } // Start monitoring multiple readers. monitor.Start(readerNames); Do not forget to register for at least one event: EventDescription A new card has been inserted. A card has been removed. Initial status. A general status change. An error occurred. An PC/SC error occurred during monitoring. The sender object. An exception containting the PC/SC error code returned from the native library. Smart card monitor factory Default factory instance. Uses for context creation. Creates a new monitor factory. Context factory that creates for the new instances. Monitors a Smart Card reader and triggers events on status changes. Creates a new thread and calls the of the given object. A general reader status change. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); // Point the callback function(s) to the pre-defined method MyStatusChangedMethod. monitor.StatusChanged += new StatusChangeEvent(MyStatusChangedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); A new card has been inserted. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.CardInserted += new CardInsertedEvent(MyCardInsertedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); A card has been removed. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.CardRemoved += new CardRemovedEvent(MyCardRemovedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); The monitor object has been initialized. This event appears only once for each reader after calling or . // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.Initialized += new CardInitializedEvent(MyCardInitializedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); An PC/SC error occurred during monitoring. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); monitor.MonitorException += new MonitorExceptionEvent(MyMonitorExceptionMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); All readers that are currently being monitored. A array of reader names. if no readers is being monitored. Indicates if there are readers currently monitored. Value Description Monitoring process ongoing. No monitoring. Releases unmanaged resources and stops the background thread (if running). Creates a new SCardMonitor object that is able to listen for certain smart card / reader changes. A smartcard context factory Scope of the establishment. This can either be a local or remote connection. Returns the current state of a reader that is currently being monitored. The number of the desired reader. The index must be between 0 and ( - 1). The current state of reader with index number . This method will throw an if the specified is invalid. You can enumerate all readers currently monitored with the property. If the specified is invalid. Returns the current state of a reader that is currently being monitored. The number of the desired reader. The index must be between 0 and ( - 1). The current state of reader with index number . This method will throw an if the specified is invalid. You can enumerate all readers currently monitored with the property. If the specified is invalid. Returns the reader name of a given . The number of the desired reader. The index must be between 0 and ( - 1). A reader name. This method will throw an if the specified is invalid. You can enumerate all readers currently monitored with the property. If the specified is invalid. The number of readers that currently being monitored. Return 0 if no reader is being monitored. Disposes the object. Dispose will call in order to stop the background thread. The application context will be disposed if you configured the monitor to do so at construction time. Disposes the object. Ignored. It will call in order to stop the background thread. The application context will be disposed if the user configured the monitor to do so at construction time. Cancels the monitoring of all readers that are currently being monitored. This will end the monitoring. The method calls the method of its Application Context to the PC/SC Resource Manager. The Smart Card reader that shall be monitored. Starts to monitor a single Smart Card reader for status changes. // Create a new monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); // Start to monitor a single reader. monitor.Start("OMNIKEY CardMan 5x21 00 00"); Do not forget to register for at least one event: EventDescription A new card has been inserted. A card has been removed. Initial status. A general status change. An error occurred. A array of reader names that shall be monitored. Starts to monitor a range Smart Card readers for status changes. string [] readerNames; using (var ctx = new SCardContext()) { ctx.Establish(SCardScope.System); // Retrieve the names of all installed readers. readerNames = ctx.GetReaders(); ctx.Release(); } // Create a new monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); foreach (string reader in readerNames) { Console.WriteLine("Start monitoring for reader {0}.", reader); } // Start monitoring multiple readers. monitor.Start(readerNames); Do not forget to register for at least one event: EventDescription A new card has been inserted. A card has been removed. Initial status. A general status change. An error occurred. A general reader status change. The sender object. Reader status information. // Create a monitor object with its own PC/SC context. var monitor = new SCardMonitor( new SCardContext(), SCardScope.System, true); // Point the callback function(s) to the pre-defined method MyStatusChangedMethod. monitor.StatusChanged += new StatusChangeEvent(MyStatusChangedMethod); // Start to monitor the reader monitor.Start("OMNIKEY CardMan 5x21 00 01"); Information about a smart card reader status change. The reader's status before this event. Is a bit mask containing one or more of the following values: StateDescription The application is unaware of the current state, and would like to know. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero. This reader should be ignored There is a difference between the state believed by the application, and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader. The given reader name is not recognized by the resource manager. If this bit is set, then and will also be set The actual state of this reader is not available. If this bit is set, then all the following bits are clear. There is no card in the reader. If this bit is set, all the following bits will be clear There is a card in the reader The card in the reader is allocated for exclusive use by another application. If this bit is set, will also be set. The card in the reader is in use by one or more other applications, but may be connected to in shared mode. If this bit is set, will also be set. There is an unresponsive card in the reader. The new status of this reader. Is a bit mask containing one or more of the following values: StateDescription The application is unaware of the current state, and would like to know. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero. This reader should be ignored There is a difference between the state believed by the application, and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader. The given reader name is not recognized by the resource manager. If this bit is set, then and will also be set The actual state of this reader is not available. If this bit is set, then all the following bits are clear. There is no card in the reader. If this bit is set, all the following bits will be clear There is a card in the reader The card in the reader is allocated for exclusive use by another application. If this bit is set, will also be set. The card in the reader is in use by one or more other applications, but may be connected to in shared mode. If this bit is set, will also be set. There is an unresponsive card in the reader. Initializes a new instance of the class. Initializes a new instance of the class. Name of the reader. The last state. The new state. The card's ATR. Holds information about the reader status. A bit mask that represents the reader status The reader's currently used protocol. A list of the reader's friendly names Gets the card's ATR. A byte array containing the ATR or null if no card connected. Creates a new instance The reader's friendly names A bit mask that represents the reader status The reader's currently used protocol. The card's ATR if available Smart card reader attribute enumeration. Can be used as parameter for the following methods: Vendor name. (SCARD_ATTR_VENDOR_NAME) Vendor-supplied interface device type (model designation of reader). (SCARD_ATTR_VENDOR_IFD_TYPE) Vendor-supplied interface device version (DWORD in the form 0xMMmmbbbb where MM = major version, mm = minor version, and bbbb = build number). (SCARD_ATTR_VENDOR_IFD_VERSION) Vendor-supplied interface device serial number. (SCARD_ATTR_VENDOR_IFD_SERIAL_NO) DWORD encoded as 0xDDDDCCCC, where DDDD = data channel type and CCCC = channel number (SCARD_ATTR_CHANNEL_ID) Asynchronous protocol types (SCARD_ATTR_ASYNC_PROTOCOL_TYPES) Default clock rate, in kHz. (SCARD_ATTR_DEFAULT_CLK) Maximum clock rate, in kHz. (SCARD_ATTR_MAX_CLK) Default data rate, in bps. (SCARD_ATTR_DEFAULT_DATA_RATE) Maximum data rate, in bps. (SCARD_ATTR_MAX_DATA_RATE) Maximum bytes for information file size device. (SCARD_ATTR_MAX_IFSD) Synchronous protocol types (SCARD_ATTR_SYNC_PROTOCOL_TYPES) Zero if device does not support power down while smart card is inserted. Nonzero otherwise. (SCARD_ATTR_POWER_MGMT_SUPPORT) User to card authentication device (SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE) User authentication input device (SCARD_ATTR_USER_AUTH_INPUT_DEVICE) DWORD indicating which mechanical characteristics are supported. If zero, no special characteristics are supported. Note that multiple bits can be set (SCARD_ATTR_CHARACTERISTICS) Current protocol type (SCARD_ATTR_CURRENT_PROTOCOL_TYPE) Current clock rate, in kHz. (SCARD_ATTR_CURRENT_CLK) Clock conversion factor. (SCARD_ATTR_CURRENT_F) Bit rate conversion factor. (SCARD_ATTR_CURRENT_D) Current guard time. (SCARD_ATTR_CURRENT_N) Current work waiting time. (SCARD_ATTR_CURRENT_W) Current byte size for information field size card. (SCARD_ATTR_CURRENT_IFSC) Current byte size for information field size device. (SCARD_ATTR_CURRENT_IFSD) Current block waiting time. (SCARD_ATTR_CURRENT_BWT) Current character waiting time. (SCARD_ATTR_CURRENT_CWT) Current error block control encoding. (SCARD_ATTR_CURRENT_EBC_ENCODING) Extended block wait time. (SCARD_ATTR_EXTENDED_BWT) Single byte indicating smart card presence(SCARD_ATTR_ICC_PRESENCE) Single byte. Zero if smart card electrical contact is not active; nonzero if contact is active. (SCARD_ATTR_ICC_INTERFACE_STATUS) Current IO state (SCARD_ATTR_CURRENT_IO_STATE) Answer to reset (ATR) string. (SCARD_ATTR_ATR_STRING) Answer to reset (ATR) string. (SCARD_ATTR_ATR_STRING) Single byte indicating smart card type (SCARD_ATTR_ICC_TYPE_PER_ATR) Esc reset (SCARD_ATTR_ESC_RESET) Esc cancel (SCARD_ATTR_ESC_CANCEL) Esc authentication request (SCARD_ATTR_ESC_AUTHREQUEST) Maximum input (SCARD_ATTR_MAXINPUT) Instance of this vendor's reader attached to the computer. The first instance will be device unit 0, the next will be unit 1 (if it is the same brand of reader) and so on. Two different brands of readers will both have zero for this value. (SCARD_ATTR_DEVICE_UNIT) Reserved for future use. (SCARD_ATTR_DEVICE_IN_USE) Device friendly name ASCII (SCARD_ATTR_DEVICE_FRIENDLY_NAME_A) Device system name ASCII (SCARD_ATTR_DEVICE_SYSTEM_NAME_A) Device friendly name UNICODE (SCARD_ATTR_DEVICE_FRIENDLY_NAME_W) Device system name UNICODE (SCARD_ATTR_DEVICE_SYSTEM_NAME_W) Supress T1 information file size request (SCARD_ATTR_SUPRESS_T1_IFS_REQUEST) Device friendly name (SCARD_ATTR_DEVICE_FRIENDLY_NAME) Device system name (SCARD_ATTR_DEVICE_SYSTEM_NAME) Smart card class Vendor information definitions Communication definitions Protocol definitions Power Management definitions Security Assurance definitions Mechanical characteristic definitions Vendor specific definitions Interface Device Protocol options ICC State specific definitions System-specific definitions Manages an application context to the PC/SC Resource Manager. Each thread of an application shall use its own SCardContext. Maximum ATR size. PlatformMaximum ATR size Windows (Winscard.dll) 36 UNIX/Linux (PC/SClite) 33 Attention: Size depends on platform. Infinite timeout. 0xFFFFFFFF Destroys application context to the PC/SC Resource Manager. Creates a new context instance Disposes a PC/SC application context. Ignored. If an application context to the PC/SC Resource Manager has been established it will call the method. Error and return codes. No error. (SCARD_S_SUCCESS) An internal consistency check failed. (SCARD_F_INTERNAL_ERROR) The action was cancelled by an request. (SCARD_E_CANCELLED) The supplied handle was invalid. (SCARD_E_INVALID_HANDLE) The supplied handle was invalid. (ERROR_INVALID_HANDLE) One or more of the supplied parameters could not be properly interpreted. (SCARD_E_INVALID_PARAMETER) Registry startup information is missing or invalid. (SCARD_E_INVALID_TARGET) Not enough memory available to complete this command. (SCARD_E_NO_MEMORY) An internal consistency timer has expired. (SCARD_F_WAITED_TOO_LONG) The data buffer to receive returned data is too small for the returned data. (SCARD_E_INSUFFICIENT_BUFFER) Windows error ERROR_INSUFFICIENT_BUFFER: The data area passed to a system call is too small. The specified reader name is not recognized. (SCARD_E_UNKNOWN_READER) The user-specified timeout value has expired. (SCARD_E_TIMEOUT) The smart card cannot be accessed because of other connections outstanding. (SCARD_E_SHARING_VIOLATION) The operation requires a Smart Card, but no Smart Card is currently in the device. (SCARD_E_NO_SMARTCARD) The specified smart card name is not recognized. (SCARD_E_UNKNOWN_CARD) The system could not dispose of the media in the requested manner. (SCARD_E_CANT_DISPOSE) The requested protocols are incompatible with the protocol currently in use with the smart card. (SCARD_E_PROTO_MISMATCH) The reader or smart card is not ready to accept commands. (SCARD_E_NOT_READY) One or more of the supplied parameters values could not be properly interpreted. (SCARD_E_INVALID_VALUE) The action was cancelled by the system, presumably to log off or shut down. (SCARD_E_SYSTEM_CANCELLED) An internal communications error has been detected. (SCARD_F_COMM_ERROR) An internal error has been detected, but the source is unknown. (SCARD_F_UNKNOWN_ERROR) An ATR obtained from the registry is not a valid ATR string. (SCARD_E_INVALID_ATR) An attempt was made to end a non-existent transaction. (SCARD_E_NOT_TRANSACTED) The specified reader is not currently available for use. (SCARD_E_READER_UNAVAILABLE) The operation has been aborted to allow the server application to exit. (SCARD_P_SHUTDOWN) The reader cannot communicate with the card, due to ATR string configuration conflicts. (SCARD_W_UNSUPPORTED_CARD) The smart card is not responding to a reset. (SCARD_W_UNRESPONSIVE_CARD) Power has been removed from the smart card, so that further communication is not possible. (SCARD_W_UNPOWERED_CARD) The smart card has been reset, so any shared state information is invalid. (SCARD_W_RESET_CARD) The smart card has been removed, so further communication is not possible. (SCARD_W_REMOVED_CARD) The PCI Receive buffer was too small. (SCARD_E_PCI_TOO_SMALL) The reader driver does not meet minimal requirements for support. (SCARD_E_READER_UNSUPPORTED) The reader driver did not produce a unique reader name. (SCARD_E_DUPLICATE_READER) The smart card does not meet minimal requirements for support. (SCARD_E_CARD_UNSUPPORTED) The Smart card resource manager is not running. (SCARD_E_NO_SERVICE) The Smart card resource manager has shut down. (SCARD_E_SERVICE_STOPPED) An unexpected card error has occurred. (SCARD_E_UNEXPECTED) Cannot find a smart card reader. (SCARD_E_NO_READERS_AVAILABLE) PC/SC Lite specific extensions Feature not supported. (SCARD_E_UNSUPPORTED_FEATURE) No primary provider can be found for the smart card. (SCARD_E_ICC_INSTALLATION) The requested order of object creation is not supported. (SCARD_E_ICC_CREATEORDER) The identified directory does not exist in the smart card. (SCARD_E_DIR_NOT_FOUND) The identified file does not exist in the smart card. (SCARD_E_FILE_NOT_FOUND) The supplied path does not represent a smart card directory. (SCARD_E_NO_DIR) The supplied path does not represent a smart card file. (SCARD_E_NO_FILE) Access is denied to this file. (SCARD_E_NO_ACCESS) The smart card does not have enough memory to store the information. (SCARD_E_WRITE_TOO_MANY) There was an error trying to set the smart card file object pointer. (SCARD_E_BAD_SEEK) The supplied PIN is incorrect. (SCARD_E_INVALID_CHV) An unrecognized error code was returned from a layered component. (SCARD_E_UNKNOWN_RES_MNG) The requested certificate does not exist. (SCARD_E_NO_SUCH_CERTIFICATE) The requested certificate could not be obtained. (SCARD_E_CERTIFICATE_UNAVAILABLE) A communications error with the smart card has been detected. (SCARD_E_COMM_DATA_LOST) The requested key container does not exist on the smart card. (SCARD_E_NO_KEY_CONTAINER) The Smart Card Resource Manager is too busy to complete this operation. (SCARD_E_SERVER_TOO_BUSY) Access was denied because of a security violation. (SCARD_W_SECURITY_VIOLATION) The card cannot be accessed because the wrong PIN was presented. (SCARD_W_WRONG_CHV) The card cannot be accessed because the maximum number of PIN entry attempts has been reached. (SCARD_W_CHV_BLOCKED) The end of the smart card file has been reached. (SCARD_W_EOF) The user pressed "Cancel" on a Smart Card Selection Dialog. (SCARD_W_CANCELLED_BY_USER) No PIN was presented to the smart card. (SCARD_W_CARD_NOT_AUTHENTICATED) Structure of protocol control information. Is a structure containing the following: typedef struct { DWORD dwProtocol; // SCARD_PROTOCOL_T0 or SCARD_PROTOCOL_T1 DWORD cbPciLength; // Length of this structure - not used } SCARD_IO_REQUEST; The pointers to the pre-defined / built-in PCI structures are determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Destroys the object and frees unmanaged memory. Initializes a new instance of the class. Creates a new SCardPCI object. Protocol Control InformationDescription Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) Size of this structure in bytes. Creates a new SCardPCI object. Protocol Control InformationDescription Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) User data. Disposes the instance and frees unmanaged memory. Disposes the instance and frees unmanaged memory. Ignored Protocol Protocol Control InformationDescription Pre-defined T=0 PCI structure. (SCARD_PCI_T0) Pre-defined T=1 PCI structure. (SCARD_PCI_T1) Pre-defined RAW PCI structure. (SCARD_PCI_RAW) Size of this structure in bytes. User data. Pre-defined T=0 PCI structure. (SCARD_PCI_T0) A pointer to the C structure in the system library. This pointer to the pre-defined / built-in PCI structure is determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Pre-defined T=1 PCI structure. (SCARD_PCI_T1) A pointer to the C structure in the system library. This pointer to the pre-defined / built-in PCI structure is determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Pre-defined RAW PCI structure. (SCARD_PCI_RAW) A pointer to the C structure in the system library. This pointer to the pre-defined / built-in PCI structure is determinated with dlsym() on UNIX/Linux hosts and GetProcAddress() on Windows hosts. Receives a PCI pointer to a given protocol. The desired protocol. A pointer to the PCI structure in the native system library. Communication protocol use with the Smart Card. This is a bit mask of acceptable protocols for the connection. You can use ( | ) if you do not have a preferred protocol. Protocol not defined. T=0 active protocol. T=1 active protocol. Raw active protocol. Use with memory type cards. T=15 protocol. ( | ). IFD (Interface device) determines protocol. A reader class that implements the most basic PC/SC functions to operate on smart cards, RFID tags and so on. It will use the system's native PC/SC API. Unmanaged resources (card handle) are released! Creates a new smart card reader object. Connection context to the PC/SC Resource Manager. // Create PC/SC context var ctx = new SCardContext(); ctx.Establish(SCardScope.System); // Create reader object and connect to the Smart Card var myReader = new SCardReader(ctx); var rc = myReader.Connect( "OMNIKEY CardMan 5321", SCardShareMode.Shared, SCardProtocol.T1); If is This will disconnect the reader if it is currently connected using . Ignored. The reader will be disconnected. Action to be taken on the reader. The disposition action is not currently used in PC/SC Lite. Do nothing. (SCARD_LEAVE_CARD) Reset the card. (SCARD_RESET_CARD) Unpower the card. (SCARD_UNPOWER_CARD) Eject the card. (SCARD_EJECT_CARD) A structures that contains the old and the new Smart Card reader status. Is used as parameter in . The new event state will be contained in . A status change might be a card insertion or removal event, a change in ATR, etc. To wait for a reader event (reader added or removed) you may use the special reader name "\\?PnP?\Notification". If a reader event occurs the state of this reader will change and the bit will be set. Frees unmanaged resources. Frees unmanaged resources. Frees unmanaged resources. Ignored. Initializes a new instance of the class. User defined data. User defined data. Current state of reader. Current state of reader. Reader state after a state change. Reader state after a state change. Number of change events. The reader's name. Answer To Reset (ATR) Scope of the establishment. The following scopes are not used on Linux/UNIX machines using the PC/SC Lite daemon: Scope in user space. Scope in terminal. Scope in system. Service on the local machine. PC/SC Lite specific extensions Scope is global. Mode of connection type: exclusive or shared. can be used before using to send control commands to the reader even if a card is not present in the reader. Contrary to Windows winscard behavior, the reader is accessed in shared mode and not exclusive mode. This application will NOT allow others to share the reader. (SCARD_SHARE_EXCLUSIVE) This application will allow others to share the reader. (SCARD_SHARE_SHARED) Direct control of the reader, even without a card. (SCARD_SHARE_DIRECT) State of the smart card in the reader. Is a bit mask that represents the current reader status. Unknown status. There is no card in the reader. There is a card in the reader, but it has not been moved into position for use. There is a card in the reader in position for use. The card is not powered. Power is being provided to the card, but the reader driver is unaware of the mode of the card. The card has been reset and is awaiting PTS negotiation. The card has been reset and specific communication protocols have been established. Reader state. The application is unaware of the current state, and would like to know. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero. (SCARD_STATE_UNAWARE) This reader should be ignored. (SCARD_STATE_IGNORE) There is a difference between the state believed by the application, and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader. (SCARD_STATE_CHANGED) The given reader name is not recognized by the resource manager. If this bit is set, then and will also be set. (SCARD_STATE_UNKNOWN) The actual state of this reader is not available. If this bit is set, then all the following bits are clear. (SCARD_STATE_UNAVAILABLE) There is no card in the reader. If this bit is set, all the following bits will be clear. (SCARD_STATE_EMPTY) There is a card in the reader. (SCARD_STATE_PRESENT) There is a card in the reader with an ATR matching one of the target cards. If this bit is set, will also be set. This bit is only returned on the SCardLocateCards() function. (SCARD_STATE_ATRMATCH) The card in the reader is allocated for exclusive use by another application. If this bit is set, will also be set. (SCARD_STATE_EXCLUSIVE) The card in the reader is in use by one or more other applications, but may be connected to in shared mode. If this bit is set, will also be set. (SCARD_STATE_INUSE) There is an unresponsive card in the reader. (SCARD_STATE_MUTE) The card is unpowered. (SCARD_STATE_UNPOWERED) Helper class that offers methods to convert various values into strings. Returns a human readable text for the given PC/SC error code. Error or return code. A human readable string. Warning! This method behaves differently compared to the original PC/SC-Lite pcsc_stringify_error function. Instead of the (const) variable name it returns a short text description. Returns a description string of an enumeration attribute. attribute type attribute If available: a description string of the specified attribute. Otherwise null.