SpringCard SpringCore Library for .NET  20.04.16
High-level access to the SpringCore devices
SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice Class Reference

SpringCore device connected through PC/SC. More...

Inheritance diagram for SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice:
SpringCard.SpringCore.Direct.DirectDevice

Public Member Functions

 SCardDirectDevice (string readerName)
 Instantiate a device given its PC/SC reader name. More...
 
 SCardDirectDevice (string[] readerNames)
 Instantiate a device given a list of PC/SC reader names. More...
 
new void Dispose ()
 Dispose of the device object. More...
 
override bool Open ()
 Open a connection to the device. More...
 
override void Close ()
 Close the connection with the device. More...
 
override void Release ()
 Release all resources associated to the device. More...
 
override bool Active ()
 Is the connection open? More...
 
IntPtr hCard ()
 
override bool Exchange (byte cla, byte[] send, out byte[] recv, ExchangeOptions options)
 Send a command to the device (and wait for its response). More...
 
override bool Exchange (byte cla, byte cmd, byte[] send_data, out byte sta, out byte[] out_data, ExchangeOptions options)
 Send a command to the device (and wait for its response). More...
 
- Public Member Functions inherited from SpringCard.SpringCore.Direct.DirectDevice
bool Exchange (byte cla, byte[] send, out byte[] recv)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (CLA cla, byte[] send, out byte[] recv, ExchangeOptions options)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (CLA cla, byte[] send, out byte[] recv)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (byte cla, byte[] send, ExchangeOptions options)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (byte cla, byte[] send)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (CLA cla, byte[] send, ExchangeOptions options)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (CLA cla, byte[] send)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (CLA cla, byte cmd, byte[] send_data, out byte sta, out byte[] out_data, ExchangeOptions options)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (CLA cla, byte cmd, byte[] send_data, out byte sta, out byte[] out_data)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (byte cla, byte cmd, byte[] send_data, ExchangeOptions options)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (byte cla, byte cmd, byte[] send_data)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (CLA cla, byte cmd, byte[] send_data, ExchangeOptions options)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (CLA cla, byte cmd, byte[] send_data)
 Send a command to the device (and wait for its response, but the response is discarded). More...
 
bool Exchange (byte cla, byte cmd, byte[] send_data, out byte[] recv_data, ExchangeOptions options)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (byte cla, byte cmd, byte[] send_data, out byte[] recv_data)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (CLA cla, byte cmd, byte[] send_data, out byte[] recv_data, ExchangeOptions options)
 Send a command to the device (and wait for its response). More...
 
bool Exchange (CLA cla, byte cmd, byte[] send_data, out byte[] recv_data)
 Send a command to the device (and wait for its response). More...
 
bool Ping ()
 Ping the device to verify that the connection stays active. More...
 
virtual string GetVendorName ()
 Get the device's Vendor Name. More...
 
virtual string GetProductName ()
 Get the device's Product Name. More...
 
virtual string GetSerialNumber ()
 Get the device's Serial Number. More...
 
virtual string GetPnpId ()
 Get the device's Plug'N'Play ID. More...
 
virtual string GetVersion ()
 Get the device's Firmware Version. More...
 
virtual string GetRevision ()
 Get the device's Firmware Revision. More...
 
virtual string GetBuildUser ()
 Get the user that has built the device's Firmware. More...
 
virtual string GetBuildDateTime ()
 Get the date and time of building the device's Firmware. More...
 
virtual string GetFirmwareName ()
 Get the name of the device's Firmware. More...
 
virtual string GetUniqueId ()
 Get the device's Unique ID. More...
 
virtual string GetConfigurationId ()
 Get the GUID of the configuration. More...
 
virtual string GetHardwareReference ()
 Get the device's Hardware Reference. More...
 
virtual string GetHardwareCharacteristics ()
 Get the device's Hardware Characteristics. More...
 
virtual string GetOriginalVendorName ()
 Get the device's original Vendor Name. More...
 
virtual string GetOriginalProductName ()
 Get the device's original Product Name. More...
 
virtual string GetDetectedProductVariant ()
 Get the device's Product Variant. More...
 
bool AuthenticateAes (KeySelect keySelect, byte[] keyValue)
 Get authenticated onto the SpringCore device (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/Secure_Communication) More...
 
bool ChangeKeyAes (KeySelect keySelect, byte[] keyValue)
 Change a key (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/PROTOCOL_class/CHANGE_KEY) More...
 
bool ResetAuthentication ()
 Clear the authenticate state (forget the session keys) More...
 
bool AuthenticateFactory (string privateKeyFile=null)
 

Static Public Member Functions

static List< string > GetDeviceList (bool filter)
 Get the list of PC/SC devices. More...
 
- Static Public Member Functions inherited from SpringCard.SpringCore.Direct.DirectDevice
static List< string > GetList (ListMode listMode)
 List the available devices. More...
 
static DirectDevice CreateNoDevice ()
 Instantiate a dummy device (for test only). More...
 
static DirectDevice Create (string devicePath, BlockingCollection< DirectDevice.IncomingEvent > eventQueue=null)
 Instantiate a device, given a devicePath returned by GetList. More...
 
static DirectDevice Create (ListMode listMode, int deviceIndex, BlockingCollection< DirectDevice.IncomingEvent > eventQueue=null)
 Instantiate a device, given an (assumed) index in the list of devices. More...
 
static DirectDevice Create (List< string > devicePaths, int deviceIndex, BlockingCollection< DirectDevice.IncomingEvent > eventQueue=null)
 Instantiate a device, given an index and the list of devices. More...
 
static byte[] CreateFactoryChallengeResponse (string privateKeyFile, byte[] challenge)
 Create a signature for the challenge, using the specified private key file (.pem format) More...
 
static byte[] CreateFactoryChallengeResponse (byte[] challenge)
 Create a signature for the challenge, using the SpringCoreAuthenticateFactory.private.pem private key (if present in the execution path) More...
 
static byte[] CreateSignature (AsymmetricCipherKeyPair privateKey, byte[] message)
 Create a signature, using the SpringCoreAuthenticitySeal.private.pem private key (if present in the execution path) More...
 
static bool IsSealValid (string publicKeyFile, byte[] subject, byte[] seal)
 Verify that the device's seal is genuine, using the specified public key file (.pem format) More...
 
static bool IsSealValid (byte[] subject, byte[] seal)
 Verify that the device's seal is genuine, using the SpringCoreAuthenticitySeal.pem public key (if present in the execution path) More...
 
static byte[] CreateSeal (string privateKeyFile, byte[] subject)
 Create a seal for the device, using the specified private key file (.pem format) More...
 
static byte[] CreateSeal (byte[] subject)
 Create a seal for the device, using the SpringCoreAuthenticitySeal.private.pem private key (if present in the execution path) More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 
- Protected Member Functions inherited from SpringCard.SpringCore.Direct.DirectDevice
void Prepare ()
 

Additional Inherited Members

- Public Types inherited from SpringCard.SpringCore.Direct.DirectDevice
enum  ListMode {
  ListMode.None = 0x0000, ListMode.Companion = 0x0001, ListMode.UsbDirect = 0x0010, ListMode.BleDirect = 0x0020,
  ListMode.Direct = 0x00F0, ListMode.Pcsc = 0x0100, ListMode.PcscAll = 0x0300
}
 How to list the devices? More...
 
enum  CLA : byte {
  CLA.Protocol = 0x00, CLA.HCE = 0x57, CLA.Control = 0x58, CLA.AtCrypto = 0x59,
  CLA.NxpSam = 0x5A, CLA.RDR = 0x5B, CLA.I2C = 0x5C, CLA.DFU = 0x5D,
  CLA.Echo = 0x5E
}
 CLAsses uses for direct communication with a SpringCore device (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/List_of_CLAsses) More...
 
enum  KeySelect : byte { KeySelect.HostCommUserKey = 0, KeySelect.HostCommAdminKey = 1 }
 Authentication mode. More...
 
- Public Attributes inherited from SpringCard.SpringCore.Direct.DirectDevice
ControlI Control
 Control interface. More...
 
AtCryptoI AtCrypto
 Crypto Companion interface. More...
 
SamAvI SamAv
 Secure Element interface. More...
 
HCEI Hce
 HCE interface. More...
 
DFUI Dfu
 DFU interface. More...
 
- Static Public Attributes inherited from SpringCard.SpringCore.Direct.DirectDevice
static bool UseLogger = false
 Forward debug information to underlying logger library? More...
 
const uint DefaultDeviceTimeout = 60000
 Default timeout when communicating with the device. More...
 
const string AuthenticySealPublicPemFile = @"SpringCoreAuthenticitySeal.pem"
 Name of the public key file (.pem format) More...
 
const string AuthenticySealPrivatePemFile = @"SpringCoreAuthenticitySeal.private.pem"
 Name of the private key file (.pem format) - for factory only. More...
 
- Protected Attributes inherited from SpringCard.SpringCore.Direct.DirectDevice
string deviceId
 
BlockingCollection< DirectDevice.IncomingEventeventQueue
 

Detailed Description

SpringCore device connected through PC/SC.

Constructor & Destructor Documentation

◆ SCardDirectDevice() [1/2]

SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.SCardDirectDevice ( string  readerName)

Instantiate a device given its PC/SC reader name.

◆ SCardDirectDevice() [2/2]

SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.SCardDirectDevice ( string[]  readerNames)

Instantiate a device given a list of PC/SC reader names.

Member Function Documentation

◆ Active()

override bool SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Active ( )
virtual

Is the connection open?

Implements SpringCard.SpringCore.Direct.DirectDevice.

◆ Close()

override void SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Close ( )
virtual

Close the connection with the device.

Implements SpringCard.SpringCore.Direct.DirectDevice.

◆ Dispose()

new void SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Dispose ( )
virtual

Dispose of the device object.

Reimplemented from SpringCard.SpringCore.Direct.DirectDevice.

◆ Exchange() [1/2]

override bool SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Exchange ( byte  cla,
byte  cmd,
byte[]  send_data,
out byte  sta,
out byte[]  out_data,
ExchangeOptions  options 
)
virtual

Send a command to the device (and wait for its response).

Implements SpringCard.SpringCore.Direct.DirectDevice.

◆ Exchange() [2/2]

override bool SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Exchange ( byte  cla,
byte[]  send,
out byte[]  recv,
ExchangeOptions  options 
)
virtual

Send a command to the device (and wait for its response).

Implements SpringCard.SpringCore.Direct.DirectDevice.

◆ GetDeviceList()

static List<string> SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.GetDeviceList ( bool  filter)
static

Get the list of PC/SC devices.

◆ Open()

override bool SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Open ( )
virtual

Open a connection to the device.

Implements SpringCard.SpringCore.Direct.DirectDevice.

◆ Release()

override void SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice.Release ( )
virtual

Release all resources associated to the device.

Implements SpringCard.SpringCore.Direct.DirectDevice.


The documentation for this class was generated from the following file: