Show / Hide Table of Contents

Interface ICardContext

Interface for card contexts, ie objects capable of managing the resources to access to readers.

Namespace: WSCT.Core
Assembly: WSCT.dll
Syntax
public interface ICardContext

Properties

| Improve this Doc View Source

Context

Accessor to the raw context.

Declaration
IntPtr Context { get; }
Property Value
Type Description
System.IntPtr
| Improve this Doc View Source

Groups

Accessor to the names of the groups of readers available (once discovered by ListReaderGroups()).

Declaration
string[] Groups { get; }
Property Value
Type Description
System.String[]
| Improve this Doc View Source

GroupsCount

Accessor to the number of groups of readers found.

Declaration
int GroupsCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Readers

Accessor to the names of readers found in the group (once discovered by ListReaders(String)).

Declaration
string[] Readers { get; }
Property Value
Type Description
System.String[]
| Improve this Doc View Source

ReadersCount

Accessor to the number of readers found.

Declaration
int ReadersCount { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Cancel()

This function terminates all outstanding actions within a specific resource manager context. SCardCancel(IntPtr)

Declaration
ErrorCode Cancel()
Returns
Type Description
ErrorCode

Success if succeeded.

| Improve this Doc View Source

Establish()

Establishes the resource manager context.

Declaration
ErrorCode Establish()
Returns
Type Description
ErrorCode

Success if succeeded.

| Improve this Doc View Source

GetStatusChange(UInt32, AbstractReaderState[])

The GetStatusChange(UInt32, AbstractReaderState[]) function blocks execution until the current availability of the cards in a specific set of readers changes. The caller supplies a list of readers to be monitored by a AbstractReaderState array and the maximum amount of time (in milliseconds) that it is willing to wait for an action to occur on one of the listed readers. Note that GetStatusChange(UInt32, AbstractReaderState[]) uses the user-supplied value in the currentState members of the readerStates AbstractReaderState array as the definition of the current state of the readers. The function returns when there is a change in availability, having filled in the EventState members of readerStates appropriately.

Declaration
ErrorCode GetStatusChange(uint timeout, AbstractReaderState[] readerStates)
Parameters
Type Name Description
System.UInt32 timeout

The maximum amount of time, in milliseconds, to wait for an action. A value of zero causes the function to return immediately. A value of INFINITE causes this function never to time out.

AbstractReaderState[] readerStates

An array of SCARD_READERSTATE structures that specify the readers to watch, and that receives the result. To be notified of the arrival of a new smart card reader, set the szReader member of a SCARD_READERSTATE structure to "\\?PnP?\Notification", and set all of the other members of that structure to zero. Important Each member of each structure in this array must be initialized to zero and then set to specific values as necessary. If this is not done, the function will fail in situations that involve remote card readers.

Returns
Type Description
ErrorCode
| Improve this Doc View Source

IsValid()

Determines whether a smart card context handle is valid.

Declaration
ErrorCode IsValid()
Returns
Type Description
ErrorCode

Success if context is valid.

| Improve this Doc View Source

ListReaderGroups()

Provides the list of groups of readers available on the system.

Declaration
ErrorCode ListReaderGroups()
Returns
Type Description
ErrorCode

Success if succeeded.

| Improve this Doc View Source

ListReaders(String)

Provides the list of readers within a set of named reader groups.

Declaration
ErrorCode ListReaders(string group)
Parameters
Type Name Description
System.String group

Name of the reader group.

Returns
Type Description
ErrorCode

Success if succeeded.

| Improve this Doc View Source

Release()

Closes the resource manager context.

Declaration
ErrorCode Release()
Returns
Type Description
ErrorCode

Success if succeeded.

Extension Methods

JsonHelpers.WriteToJsonFile(Object, String)
JsonHelpers.WriteToJsonFile(Object, String, Boolean)
JsonHelpers.WriteToJsonString(Object)
JsonHelpers.WriteToJsonString(Object, Boolean)
CardContextExtension.ToObservable(ICardContext)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX