Platforms to show: All Mac Windows Linux Cross-Platform
TKSmartCardMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | SmartCard | MBS Mac64bit Plugin | 18.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This class provides an interface for managing sessions with a smart card, transmitting requests, and facilitating user interaction.
You can create a TKSmartCardMBS object when a smart card is inserted into a slot, by calling the makeSmartCard method on the corresponding TKSmartCardSlotMBS object. To start communicating with the smart card, call the beginSession method on the TKSmartCardMBS object. Once an exclusive session has been established, you transmit data using the transmitRequest:reply: method. After you’ve finished communicating with a smart card, you call the endSession method.
If the smart card is physically removed from its slot, the session object becomes invalid, and any further calls to transmitRequest will return an error.
- 5 events
- event beginSessionCompleted(success as Boolean, error as NSErrorMBS, tag as Variant)
- event inSession(byref error as NSErrorMBS, tag as Variant) as Boolean
- event sendInsCompleted(ins as UInt8, p1 as UInt8, p2 as UInt8, requestData as MemoryBlock, le as integer, replyData as MemoryBlock, sw as UInt16, error as NSErrorMBS, tag as Variant)
- event transmitRequestCompleted(request as MemoryBlock, response as MemoryBlock, error as NSErrorMBS, tag as Variant)
- event ValidChanged
- 10 properties
- property AllowedProtocols as Integer
- property cla as Integer
- property Context as Variant
- property CurrentProtocol as Integer
- property Handle as Integer
- property Sensitive as Boolean
- property Slot as TKSmartCardSlotMBS
- property UseCommandChaining as Boolean
- property UseExtendedLength as Boolean
- property Valid as Boolean
- 16 methods
- method beginSession(tag as variant = nil)
- method beginSessionSync(byref error as NSErrorMBS) as Boolean
- method beginSessionWithDelegate(handler as beginSessionCompletedDelegateMBS, tag as variant = nil)
- method Constructor
- method Destructor
- method endSession
- method inSession(byref error as NSErrorMBS, tag as variant = nil) as boolean
- method readFileWithDelegate(FileName as MemoryBlock, handler as readFileCompletedDelegateMBS, tag as variant = nil)
- method sendIns(ins as UInt8, p1 as UInt8, p2 as UInt8, requestData as MemoryBlock, le as Integer = 0, byref sw as Uint16, byref error as NSErrorMBS) as Memoryblock
- method sendIns(ins as UInt8, p1 as UInt8, p2 as UInt8, requestData as MemoryBlock, le as Integer = 0, tag as variant = nil)
- method SetDelegate
- method transmitRequest(request as MemoryBlock, tag as variant = nil)
- method transmitRequestSync(request as MemoryBlock, byref response as MemoryBlock, byref error as NSErrorMBS)
- method transmitRequestWithDelegate(request as MemoryBlock, handler as transmitRequestCompletedDelegateMBS, tag as variant = nil)
- method userInteractionForSecurePINChange(PINFormat as TKSmartCardPINFormatMBS, APDU as MemoryBlock, currentPINByteOffset as Integer, newPINByteOffset as Integer) as TKSmartCardUserInteractionForSecurePINChangeMBS
- method userInteractionForSecurePINVerification(PINFormat as TKSmartCardPINFormatMBS, APDU as MemoryBlock, PINByteOffset as Integer) as TKSmartCardUserInteractionForSecurePINVerificationMBS
- 3 delegates
- delegate beginSessionCompletedDelegateMBS(success as Boolean, error as NSErrorMBS, tag as Variant)
- delegate readFileCompletedDelegateMBS(FileName as MemoryBlock, Content as MemoryBlock, error as NSErrorMBS, tag as Variant)
- delegate transmitRequestCompletedDelegateMBS(request as MemoryBlock, response as MemoryBlock, error as NSErrorMBS, tag as Variant)
- 14 constants
Protocols
Constant | Value | Description |
---|---|---|
kProtocolAny | 65535 |
Any available transmission protocols. |
kProtocolNone | 0 |
No transmission protocols. |
kProtocolT0 | 1 |
T=0 transmission protocol. |
kProtocolT1 | 2 |
T=1 transmission protocol. |
kProtocolT15 | 32768 |
T=15 transmission protocol. |
Errors
Constant | Value | Description |
---|---|---|
TKErrorCodeAuthenticationFailed | -5 |
Authentication failed. |
TKErrorCodeAuthenticationNeeded | -9 |
Authentication is needed. |
TKErrorCodeBadParameter | -8 |
An invalid parameter was provided. |
TKErrorCodeCanceledByUser | -4 |
The operation was canceled by the user. |
TKErrorCodeCommunicationError | -2 |
A communication error occurred. |
TKErrorCodeCorruptedData | -3 |
The data was corrupted. |
TKErrorCodeNotImplemented | -1 |
The functionality is not implemented. |
TKErrorCodeObjectNotFound | -6 |
The object was not found. |
TKErrorCodeTokenNotFound | -7 |
The token was not found. |
This class has no sub classes.
Some methods using this class:
- TKSmartCardSlotMBS.makeSmartCard as TKSmartCardMBS
- TKSmartCardTokenMBS.Constructor(smartCard as TKSmartCardMBS, AID as MemoryBlock, instanceID as String, tokenDriver as TKSmartCardTokenDriverMBS)
Some properties using for this class:
- TKSmartCardTokenSessionMBS.smartCard as TKSmartCardMBS
- TKTokenSmartCardPINAuthOperationMBS.smartCard as TKSmartCardMBS
Some events using this class:
- TKTokenDriverMBS.createTokenForSmartCard(smartCard as TKSmartCardMBS, AID as MemoryBlock, byref error as NSErrorMBS) as TKSmartCardTokenMBS
Some examples using this class:
The items on this page are in the following plugins: MBS Mac64bit Plugin.
TKSmartCardATRMBS - TKSmartCardPINFormatMBS