Carica nell'oggetto DiMaTek un CertStore (file in formato pfx)
LONG WINAPI dmtLoadCertStoreFile (
HDMTOBJ hDmt,
CHAR *szStoreLocation /*= ""*/,
CHAR *szStorePassword /*= ""*/)
External_Function dmtLoadCertStoreFile "dmtLoadCertStoreFile" Dimatec.dll ;
Handle hDmt ;
String szStoreLocation ; // = ""
String szStorePassword ; // = ""
Returns Integer
Public Declare Function dmtLoadCertStoreFile Lib "Dimatec.dll" _
(ByVal hDmt As Long, _
Optional ByVal szStoreLocation As String = "", _
Optional ByVal szStorePassword As String = "") _
As Long
[DllImport("Dimatec.dll")]
public static extern int dmtLoadCertStoreFile (
int hDmt,
string szStoreLocation,
string szStorePassword);
hDmt - Handle dell'oggetto DiMaTek
szStoreLocation - File pfx contenente lo store di certificati
szStorePassword - Password dello store di certificati da caricare
DMT_OK in caso di successo, altrimenti un codice di errore
Integer ret
String szCertStore szCertStorePassword
Get Label of oTextBox_LoadCertStore to szCertStore
Get Value of oForm_LoadCertStorePassword to szCertStorePassword
If (Length(Trim(szCertStore)) > 0) Begin
Move (dmtLoadCertStoreFile( ;
ghdmt , ;
szCertStore , ;
szCertStorePassword)) to ret
End
Dim res As Long
' Check
If (Len(Trim(txt_SaveCertStore.Text)) = 0) Then
MsgBox "Certstore file name empty", vbCritical, "LoadCertStore"
Exit Sub
End If
res = dmtSaveCertStoreFile(g_hDmt, _
Trim(txt_SaveCertStore.Text), _
Trim(txt_SaveCertStorePsw.Text))
// Loading pfx certstore
int LoadPfxCertstoreResult = CDIMATECLIBRARY.dmtLoadCertStoreFile(
CDIMATECLIBRARY.ghDimatecObj,
labelPfx.Text,
textBoxPfxPassword.Text);