Platforms to show: All Mac Windows Linux Cross-Platform

Back to SmartCardContextMBS class.

SmartCardContextMBS.Cancel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Terminates all outstanding actions within a specific resource manager context.

The only requests that you can cancel are those that require waiting for external action by the smart card or user. Any such outstanding action requests will terminate with a status indication that the action was canceled. This is especially useful to force outstanding GetStatusChange calls to terminate.

Lasterror is set.

SmartCardContextMBS.Connect(reader as string, ShareMode as UInt32, PreferredProtocols as UInt32) as SmartCardMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Connects to a smartcard.
Example
dim c as new SmartCardContextMBS

dim s as SmartCardMBS
s = c.Connect("MyReader", SmartCardMBS.kShareShared, SmartCardMBS.kProtocolAny)
if s <> nil then
MsgBox "Connected"
else
MsgBox "Error: "+str(c.Lasterror)
end if

Establishes a connection (using a specific resource manager context) between the calling application and a smart card contained by a specific reader. If no card exists in the specified reader, an error is returned.

Reader: The name of the reader that contains the target card.
ShareMode: A flag that indicates whether other applications may form connections to the card. Use one of SmartCardMBS.kShare* constants. e.g. kShareExclusive
PreferredProtocols: A bitmask of acceptable protocols for the connection. Possible values may be combined with the OR operation. Use SmartCardMBS.kProtocol* constants. e.g. kProtocolT1

Lasterror and ActiveProtocol are set.
Returns on success a smartcard object, else returns nil.

SmartCardContextMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Initializes a smartcard context.

SmartCardContextMBS.IsValid as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Determines whether a smart card context handle is valid.

Returns true if valid or false if not valid.

SmartCardContextMBS.ReaderGroups as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Provides the list of reader groups that have previously been introduced to the system.

The groups may be SCard$AllReaders, SCard$DefaultReaders, SCard$LocalReaders and SCard$SystemReaders.
Lasterror is set.

Some examples using this method:

SmartCardContextMBS.Readers as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Provides the list of readers within a set of named reader groups, eliminating duplicates.
Example
dim c as new SmartCardContextMBS
dim list() as string = c.Readers
MsgBox Join(list, EndOfLine)

Lasterror is set.

See also:

Some examples using this method:

SmartCardContextMBS.Readers(ReaderGroups() as string) as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SmartCard MBS Tools Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Provides the list of readers within a set of named reader groups, eliminating duplicates.

The caller supplies a list of reader groups, and receives the list of readers within the named groups. Unrecognized group names are ignored. This function only returns readers within the named groups that are currently attached to the system and available for use.

ReaderGroups: The reader groups you like to query.
Lasterror is set.

See also:

The items on this page are in the following plugins: MBS Tools Plugin.


The biggest plugin in space...