firma digital

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

firma digital

Post 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 2788 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,
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: firma digital

Post 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 ....
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: firma digital

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: firma digital

Post 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)
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
nelstu
Posts: 60
Joined: Mon Jul 30, 2012 10:41 pm

Re: firma digital

Post by nelstu »

Hola daniel, al final pudistes hacer llamada a la DLL, consulta como la construistes?

slds

NS
Post Reply