Abtract class that gives a high-level access to SpringCore devices. Child classes implements the direct commununication layer, depending on how the device is connected to the computer. More...
Public Types | |
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 Member Functions | |
abstract bool | Open () |
Open a connection to the device. More... | |
abstract void | Close () |
Close the connection with the device. More... | |
abstract void | Release () |
Release the device but keep the connection open. More... | |
abstract bool | Active () |
Is the connection open and not released? More... | |
virtual void | Dispose () |
Dispose of the device object. More... | |
abstract bool | Exchange (byte cla, byte[] send, out byte[] recv, ExchangeOptions options) |
Send a command to the device (and wait for its response). More... | |
abstract 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... | |
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 > | 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... | |
Public Attributes | |
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 | |
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 Member Functions | |
void | Prepare () |
Protected Attributes | |
string | deviceId |
BlockingCollection< DirectDevice.IncomingEvent > | eventQueue |
Abtract class that gives a high-level access to SpringCore devices. Child classes implements the direct commununication layer, depending on how the device is connected to the computer.
|
strong |
CLAsses uses for direct communication with a SpringCore device (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/List_of_CLAsses)
Enumerator | |
---|---|
Protocol | PROTOCOL class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/PROTOCOL_class/) |
HCE | HCE class |
Control | CONTROL class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/CONTROL_class/) |
AtCrypto | CRYPTO_COMPANION class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/CRYPTO_COMPANION_class/) |
NxpSam | SECURE_ELEMENT class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/SECURE_ELEMENT_class/) |
RDR | READER class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/READER_class) |
I2C | I2C class |
DFU | DFU class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/DFU_class) |
Echo | ECHO class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/ECHO_class) |
|
strong |
How to list the devices?
Enumerator | |
---|---|
None | Dummy value, will not return anything |
Companion | List devices available through the SpringCard Companion REST service |
UsbDirect | List devices connected through USB Direct |
BleDirect | List devices connected through BLE Direct |
Direct | List all Direct devices |
Pcsc | List devices connected through PC/SC, only if their Vendor Name is SpringCard |
PcscAll | List devices connected through PC/SC, even if their Vendor Name is not SpringCard |
|
pure virtual |
Is the connection open and not released?
Implemented in SpringCard.SpringCore.Direct.Usb.UsbDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, SpringCard.SpringCore.Direct.Ble.BleDirectDevice, and SpringCard.SpringCore.Direct.CompanionDirectDevice.
bool SpringCard.SpringCore.Direct.DirectDevice.AuthenticateAes | ( | KeySelect | keySelect, |
byte[] | keyValue | ||
) |
Get authenticated onto the SpringCore device (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/Secure_Communication)
bool SpringCard.SpringCore.Direct.DirectDevice.ChangeKeyAes | ( | KeySelect | keySelect, |
byte[] | keyValue | ||
) |
|
pure virtual |
Close the connection with the device.
Implemented in SpringCard.SpringCore.Direct.Usb.UsbDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, SpringCard.SpringCore.Direct.Ble.BleDirectDevice, and SpringCard.SpringCore.Direct.CompanionDirectDevice.
|
static |
Instantiate a device, given an index and the list of devices.
|
static |
Instantiate a device, given an (assumed) index in the list of devices.
|
static |
Instantiate a device, given a devicePath returned by GetList.
|
static |
Create a signature for the challenge, using the SpringCoreAuthenticateFactory.private.pem private key (if present in the execution path)
|
static |
Create a signature for the challenge, using the specified private key file (.pem format)
|
static |
Instantiate a dummy device (for test only).
|
static |
Create a seal for the device, using the SpringCoreAuthenticitySeal.private.pem private key (if present in the execution path)
|
static |
Create a seal for the device, using the specified private key file (.pem format)
|
static |
Create a signature, using the SpringCoreAuthenticitySeal.private.pem private key (if present in the execution path)
|
virtual |
Dispose of the device object.
Reimplemented in SpringCard.SpringCore.Direct.Ble.BleDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, and SpringCard.SpringCore.Direct.Usb.UsbDirectDevice.
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | byte | cla, |
byte | cmd, | ||
byte[] | send_data | ||
) |
Send a command to the device (and wait for its response, but the response is discarded).
bool SpringCard.SpringCore.Direct.DirectDevice.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).
|
pure virtual |
Send a command to the device (and wait for its response).
Implemented in SpringCard.SpringCore.Direct.Usb.UsbDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, SpringCard.SpringCore.Direct.Ble.BleDirectDevice, and SpringCard.SpringCore.Direct.CompanionDirectDevice.
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | byte | cla, |
byte | cmd, | ||
byte[] | send_data, | ||
out byte[] | recv_data | ||
) |
Send a command to the device (and wait for its response).
bool SpringCard.SpringCore.Direct.DirectDevice.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).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | byte | cla, |
byte[] | send | ||
) |
Send a command to the device (and wait for its response, but the response is discarded).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | byte | cla, |
byte[] | send, | ||
ExchangeOptions | options | ||
) |
Send a command to the device (and wait for its response, but the response is discarded).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | byte | cla, |
byte[] | send, | ||
out byte[] | recv | ||
) |
Send a command to the device (and wait for its response).
|
pure virtual |
Send a command to the device (and wait for its response).
Implemented in SpringCard.SpringCore.Direct.Usb.UsbDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, SpringCard.SpringCore.Direct.CompanionDirectDevice, and SpringCard.SpringCore.Direct.Ble.BleDirectDevice.
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | CLA | cla, |
byte | cmd, | ||
byte[] | send_data | ||
) |
Send a command to the device (and wait for its response, but the response is discarded).
bool SpringCard.SpringCore.Direct.DirectDevice.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).
bool SpringCard.SpringCore.Direct.DirectDevice.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).
bool SpringCard.SpringCore.Direct.DirectDevice.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).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | CLA | cla, |
byte | cmd, | ||
byte[] | send_data, | ||
out byte[] | recv_data | ||
) |
Send a command to the device (and wait for its response).
bool SpringCard.SpringCore.Direct.DirectDevice.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).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | CLA | cla, |
byte[] | send | ||
) |
Send a command to the device (and wait for its response, but the response is discarded).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | CLA | cla, |
byte[] | send, | ||
ExchangeOptions | options | ||
) |
Send a command to the device (and wait for its response, but the response is discarded).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | CLA | cla, |
byte[] | send, | ||
out byte[] | recv | ||
) |
Send a command to the device (and wait for its response).
bool SpringCard.SpringCore.Direct.DirectDevice.Exchange | ( | CLA | cla, |
byte[] | send, | ||
out byte[] | recv, | ||
ExchangeOptions | options | ||
) |
Send a command to the device (and wait for its response).
|
virtual |
Get the date and time of building the device's Firmware.
|
virtual |
Get the user that has built the device's Firmware.
|
virtual |
Get the GUID of the configuration.
|
virtual |
Get the device's Product Variant.
|
virtual |
Get the name of the device's Firmware.
|
virtual |
Get the device's Hardware Characteristics.
|
virtual |
Get the device's Hardware Reference.
|
static |
List the available devices.
|
virtual |
Get the device's original Product Name.
|
virtual |
Get the device's original Vendor Name.
|
virtual |
Get the device's Plug'N'Play ID.
Reimplemented in SpringCard.SpringCore.Direct.Ble.BleDirectDevice.
|
virtual |
Get the device's Product Name.
Reimplemented in SpringCard.SpringCore.Direct.Ble.BleDirectDevice.
|
virtual |
Get the device's Firmware Revision.
|
virtual |
Get the device's Serial Number.
Reimplemented in SpringCard.SpringCore.Direct.Ble.BleDirectDevice.
|
virtual |
Get the device's Unique ID.
|
virtual |
Get the device's Vendor Name.
Reimplemented in SpringCard.SpringCore.Direct.Ble.BleDirectDevice.
|
virtual |
Get the device's Firmware Version.
|
static |
Verify that the device's seal is genuine, using the SpringCoreAuthenticitySeal.pem public key (if present in the execution path)
|
static |
Verify that the device's seal is genuine, using the specified public key file (.pem format)
|
pure virtual |
Open a connection to the device.
Implemented in SpringCard.SpringCore.Direct.Ble.BleDirectDevice, SpringCard.SpringCore.Direct.CompanionDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, and SpringCard.SpringCore.Direct.Usb.UsbDirectDevice.
bool SpringCard.SpringCore.Direct.DirectDevice.Ping | ( | ) |
Ping the device to verify that the connection stays active.
|
pure virtual |
Release the device but keep the connection open.
Implemented in SpringCard.SpringCore.Direct.Usb.UsbDirectDevice, SpringCard.SpringCore.Direct.PCSC.SCardDirectDevice, SpringCard.SpringCore.Direct.Ble.BleDirectDevice, and SpringCard.SpringCore.Direct.CompanionDirectDevice.
bool SpringCard.SpringCore.Direct.DirectDevice.ResetAuthentication | ( | ) |
Clear the authenticate state (forget the session keys)
AtCryptoI SpringCard.SpringCore.Direct.DirectDevice.AtCrypto |
Crypto Companion interface.
|
static |
Name of the private key file (.pem format) - for factory only.
|
static |
Name of the public key file (.pem format)
ControlI SpringCard.SpringCore.Direct.DirectDevice.Control |
Control interface.
|
static |
Default timeout when communicating with the device.
DFUI SpringCard.SpringCore.Direct.DirectDevice.Dfu |
DFU interface.
HCEI SpringCard.SpringCore.Direct.DirectDevice.Hce |
HCE interface.
SamAvI SpringCard.SpringCore.Direct.DirectDevice.SamAv |
Secure Element interface.
|
static |
Forward debug information to underlying logger library?