GetDriverStringA
Declaration
Delphi
function GetDriverStringA(Key: Cardinal): PChar;
C/C++
SOPAD_API char* SOPAD_GetDriverStringA(DWORD dwKey);
Â
ActiveX
HRESULT GetDriverString([in] long Key, [out, retval] BSTR* Result);
Description
This function returns string values.
Arguments
Key
Numerical value, must be equal to one of possible values from the table (see below).
Â
Possible combinations of key and value
Possible combinations of key and value are listed int the table.
Key | Value |
---|---|
0 | Configured device name |
1 | Serial number of device or empty string |
3 | XML certificate |
4 | Page number string (for color devices) |
5 | Hash sum of device public key 1 |
6 | Firmware version |
7 | unused |
8 | unused |
9 | Get the Password for Virtual hosted WLAN (SMARTPhone with soWifiCom.dll ) |
10 | Get the SSID name for Virtual hosted WLAN (SMARTPhone with soWifiCom.dll ) |
11 | Function retrieves CryptoID container information from device or returns NULL if pad does not support CryptoID V2. The Result is formated to XML and the XSD definition can found in the Samples section. |
Return value
Function returns string Pointer to value which corresponds to the Key parameter.
Â
Sample
C# Sample to collect signature raw data and how to decrypt them
private string GetFileContentAsString(String FileName, bool asHexString) { string result = ""; if (!asHexString) { result = File.ReadAllText(FileName); } else { byte[] fileBytes = File.ReadAllBytes(FileName); result = BitConverter.ToString(fileBytes); result = result.Replace("-", ""); } return result; } // function to test SetDriverString and GetDriverString private void testSetDriverStringFunction() { string driverXmlWriteAsStr = GetFileContentAsString(@"C:\\temp\\DriverXmlFile.xml", false); //IntPtr driverXmlWrite = Marshal.StringToHGlobalAnsi(driverXmlWriteAsStr); sopadDLL.SOPAD_SetDriverString(3, driverXmlWriteAsStr); IntPtr driverXMLRead = sopadDLL.SOPAD_GetDriverStringA(3); string driverXMLReadAsStr = Marshal.PtrToStringAnsi(driverXMLRead); if (driverXmlWriteAsStr.Equals(driverXMLReadAsStr)) { Console.WriteLine("setdriverstring works fine!"); } else { Console.WriteLine("setdriverstring failed!"); } }