dmtLoadCertStoreFile

Carica nell'oggetto DiMaTek un CertStore (file in formato pfx)

 

Dichiarazione - C

LONG WINAPI dmtLoadCertStoreFile (

HDMTOBJ hDmt,

CHAR *szStoreLocation /*= ""*/,

CHAR *szStorePassword /*= ""*/)

 

Dichiarazione - Visual Dataflex

External_Function dmtLoadCertStoreFile "dmtLoadCertStoreFile" Dimatec.dll ;

Handle hDmt ;

String szStoreLocation ;         // = ""

String szStorePassword ;         // = ""

Returns Integer

Dichiarazione - Visual Basic

Public Declare Function dmtLoadCertStoreFile Lib "Dimatec.dll" _

(ByVal hDmt As Long, _

Optional ByVal szStoreLocation As String = "", _

Optional ByVal szStorePassword As String = "") _

As Long

 

Dichiarazione - C Sharp

[DllImport("Dimatec.dll")]

public static extern int dmtLoadCertStoreFile (

int hDmt,

string szStoreLocation,

string szStorePassword);

 

Parametri di input:
Valore di ritorno:

DMT_OK in caso di successo, altrimenti un codice di errore

 


Esempi di utilizzo

Visual Dataflex

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

Visual Basic

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))

 

C Sharp

// Loading pfx certstore

int LoadPfxCertstoreResult = CDIMATECLIBRARY.dmtLoadCertStoreFile(

    CDIMATECLIBRARY.ghDimatecObj,

    labelPfx.Text,

    textBoxPfxPassword.Text);