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.

KeyValue
0Configured device name
1Serial number of device or empty string
3XML certificate
4Page number string (for color devices)
5Hash sum of device public key 1
6Firmware version
7unused
8unused
9Get the Password for Virtual hosted WLAN (SMARTPhone with soWifiCom.dll )
10Get 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!");
    }
}