Crescendo SDK
Loading...
Searching...
No Matches
CrescendoDLL.PCSC.AppletAbstract Class Referenceabstract

An abstract class representing an applet on the Crescendo token. More...

Inherited by CrescendoDLL.PCSC.ACA, CrescendoDLL.PCSC.CardManager, CrescendoDLL.PCSC.FIDO, CrescendoDLL.PCSC.OATH, and CrescendoDLL.PCSC.PIV.

Public Member Functions

Result Select ()
 Select the applet on the token.
 
void UpdateAppletProperties ()
 Update the applet properties - read them again from the token.
 

Public Attributes

APDUEngine Engine
 Instance of the APDU engine used to communicate with the token.
 

Protected Member Functions

AppletProperties CreatePropsFromSelectResponse (byte[] selectResponse)
 Create the applet properties from the select response.
 
Result Transmit (CommandApdu command)
 Transmit an APDU command to the token.
 

Protected Attributes

SCardProtocol ActiveProtocol
 The active protocol for the current applet.
 

Properties

CommandApdu CurrentCommand [get, set]
 Last APDU command send to the token.
 
Response LastResponse [get]
 Last APDU response received from the token.
 
AppletProperties Properties [get, set]
 Properties of the current applet.
 

Detailed Description

An abstract class representing an applet on the Crescendo token.

Member Function Documentation

◆ CreatePropsFromSelectResponse()

AppletProperties CrescendoDLL.PCSC.AppletAbstract.CreatePropsFromSelectResponse ( byte[]  selectResponse)
abstractprotected

Create the applet properties from the select response.

Parameters
selectResponse
Returns
An instance of CrescendoDLL.PCSC.AppletProperties.

Referenced by CrescendoDLL.PCSC.AppletAbstract.Select().

◆ Select()

Result CrescendoDLL.PCSC.AppletAbstract.Select ( )
inline

Select the applet on the token.

Returns
A Result object, where IsSuccess indicates successful applet selection.
See documentation for Result for more details.

This method will attempt to select the applet on the token. If the applet is already selected, the method will return success without re-selecting the applet.
If the Select APDU command succeeds, the CrescendoDLL.PCSC.AppletAbstract.Properties will be updated.

References CrescendoDLL.PCSC.AppletAbstract.ActiveProtocol, CrescendoDLL.PCSC.AppletAbstract.CreatePropsFromSelectResponse(), CrescendoDLL.PCSC.AppletAbstract.CurrentCommand, CrescendoDLL.PCSC.AppletAbstract.Engine, CrescendoDLL.PCSC.AppletAbstract.LastResponse, CrescendoDLL.PCSC.AppletProperties.ParsePropertiesData(), and CrescendoDLL.PCSC.AppletAbstract.Properties.

Referenced by CrescendoDLL.PCSC.AppletAbstract.Transmit().

◆ Transmit()

Result CrescendoDLL.PCSC.AppletAbstract.Transmit ( CommandApdu  command)
inlineprotected

Transmit an APDU command to the token.

Parameters
commandThe APDU command that should be sent to the token. The object itself is defined in PCSC.Iso7816 project.
Returns
A Result object, where IsSuccess indicates successful APDU transmit (received response is 9000).
If the APDU response is not 9000, the Error property will contain the error code and message.
See documentation for Result for more details.

This method first ensures that the applet is selected before transmitting the APDU command by calling CrescendoDLL.PCSC.AppletAbstract.Select.
Then is uses the CrescendoDLL.PCSC.APDUEngine.Transmit method to send the APDU command to the token.

References CrescendoDLL.PCSC.AppletAbstract.Engine, and CrescendoDLL.PCSC.AppletAbstract.Select().

◆ UpdateAppletProperties()

void CrescendoDLL.PCSC.AppletAbstract.UpdateAppletProperties ( )
inline

Update the applet properties - read them again from the token.

Exceptions
ExceptionThrows when the Get Properties APDU call to the applet fails.

References CrescendoDLL.PCSC.AppletAbstract.Engine, CrescendoDLL.PCSC.AppletProperties.ParsePropertiesData(), and CrescendoDLL.PCSC.AppletAbstract.Properties.

Member Data Documentation

◆ ActiveProtocol

SCardProtocol CrescendoDLL.PCSC.AppletAbstract.ActiveProtocol
protected

The active protocol for the current applet.

Referenced by CrescendoDLL.PCSC.AppletAbstract.Select().

◆ Engine

APDUEngine CrescendoDLL.PCSC.AppletAbstract.Engine

Property Documentation

◆ CurrentCommand

CommandApdu CrescendoDLL.PCSC.AppletAbstract.CurrentCommand
getsetprotected

Last APDU command send to the token.

Referenced by CrescendoDLL.PCSC.AppletAbstract.Select().

◆ LastResponse

Response CrescendoDLL.PCSC.AppletAbstract.LastResponse
getprotected

Last APDU response received from the token.

Referenced by CrescendoDLL.PCSC.AppletAbstract.Select().

◆ Properties

AppletProperties CrescendoDLL.PCSC.AppletAbstract.Properties
getsetprotected