Page 2 of 2

firma digital

Posted: Thu Jun 18, 2015 8:37 pm
by Pablo César
Hola Daniel,

Todavia no tuve tiempo de mirar tu código posteado. Pero aqui por tu ultimo mensaje se vé que en el segundo parametro que pusiste en HMG_CallDLL deberia ser del tipo numérico de acuerdo la documentacion.
Pantalla1.png
Pantalla1.png (45.31 KiB) Viewed 3003 times
No sé si esto te resuelve pero mejor usar como dice. No creo que en el segundo parametro tengas que usar el handle. Fijate en el archvio hbdyn.ch las opciones que cuentas.

Un abrazo,

Re: firma digital

Posted: Thu Jun 18, 2015 10:56 pm
by danielmaximiliano
Hola Pablo ; Claudio Soto y demás ..

creo que mi error se debe a esto ...
(Source XMLSEC.C )

Code: Select all

/**
 * xmlSecInit:
 *
 * Initializes XML Security Library. The depended libraries
 * (LibXML and LibXSLT) must be initialized before.
 *
 * Returns: 0 on success or a negative value otherwise.
 */
sigo investigando ....

Re: firma digital

Posted: Thu Jun 18, 2015 11:45 pm
by srvet_claudio
danielmaximiliano wrote:
Pablo César wrote:Gracias Daniel + Claudio por la dedicacion y logros. La verdad que es muy importante que dominemos el uso de DLLs de dentro del HMG.
No pude ni puedo hacer que funcione el retorno del Init de XMLSec, este debe devolve 0 o negativo si no se cargo la libreria..

nHandler := HMG_CallDLL("libxmlsec1.dll" , "xmlSecInit" , @nTrue )
nHandler := HMG_CallDLL("libxmlsec1.dll" , "xmlSecInit()" , @nTrue )


or

nTrue := HMG_CallDLL("libxmlsec1.dll" , nHandler , "xmlSecInit" )
nTrue := HMG_CallDLL("libxmlsec1.dll" , nHandler , "xmlSecInit()" )
Según la doc: https://www.aleksey.com/xmlsec/api/xmlsec-xmlsec.html:

Code: Select all

// int xmlSecInit (void); 
//     - Initializes XML Security Library. The depended libraries (LibXML and LibXSLT) must be initialized before.
//     - Returns : 0 on success or a negative value otherwise.

nError := HMG_CallDLL("libxmlsec1.dll" , HB_DYN_CTYPE_INT, "xmlSecInit" )
IF nError <> 0
   // error
ENDIF

Re: firma digital

Posted: Fri Jun 19, 2015 12:37 am
by danielmaximiliano
srvet_claudio wrote:

Code: Select all

// int xmlSecInit (void); 
//     - Initializes XML Security Library. The depended libraries (LibXML and LibXSLT) must be initialized before.
//     - Returns : 0 on success or a negative value otherwise.

nError := HMG_CallDLL("libxmlsec1.dll" , HB_DYN_CTYPE_INT, "xmlSecInit" )
IF nError <> 0
   // error
ENDIF
Sigue devolviendo "U"

Code: Select all

#include <hmg.ch>
#include "hbdyn.ch"

Function Main
Local nHandler , nError
Local nTrue 
Local nFalse
 Load Window Main
        Main.Center
		
nError := HMG_CallDLL("libxmlsec1.dll" , HB_DYN_CTYPE_INT, "xmlSecInit" )
IF nError <> 0
    msgbox( valtype ( nError ), Valtype (nHandler) )
ENDIF
 
Return
se debe que no estan inicializado LibXML and LibXSLT segun el siguiente codigo tanto en .NET, Pyton etc, etc

Code: Select all

import libxml2
import xmlsec

def main():
    assert(sys.argv)
    if len(sys.argv) < 3:
        print "Error: wrong number of arguments."
        print "Usage: %s <xml-tmpl> <key-file>" % sys.argv[0]
        return sys.exit(1)
    
    # Init libxml library
    libxml2.initParser()
    libxml2.substituteEntitiesDefault(1)

    # Init xmlsec library
    if xmlsec.init() < 0:
        print "Error: xmlsec initialization failed."
        return sys.exit(-1)

Re: firma digital

Posted: Wed Nov 18, 2015 8:03 pm
by nelstu
Hola daniel, al final pudistes hacer llamada a la DLL, consulta como la construistes?

slds

NS