Smart Card reader

406 views
Skip to first unread message

Maurizio la Cecilia

unread,
Mar 23, 2022, 3:23:40 PM3/23/22
to Harbour Users
I need to digitally sign the documents produced by my Harbour business app.
Did someone of you had same problem?
I figure that my app will need SSL, and that shouldn't represent a
blocking factor, but I didn't found any lib able to manage a smart card
reader.
Any suggestion will be much appreciated.
TIA
--

Maurizio

Antonio Carlos Pantaglione

unread,
Mar 24, 2022, 2:07:48 PM3/24/22
to Harbour Users
Hi Maurizio.

I use chilkat DLL for that, please look at it.






I attach a simple sample code that load a XML and read some tags:

---cut---

static procedure testChilkat()    

local oGlobal := win_OleGetActiveObject( "Chilkat_9_5_0.Global.1" )    
local oXml    

static procedure testChilkat()

   local oGlobal := win_OleGetActiveObject( "Chilkat_9_5_0.Global.1" )

   local oXml

   if !hb_IsObject( oGlobal )
      oGlobal = win_OleCreateObject( "Chilkat_9_5_0.Global.1" )
   endif

   if hb_IsObject( oGlobal )

      if oGlobal:UnlockBundle( "Start my 30-day Trial" ) == 1

         oXml = win_OleGetActiveObject( "Chilkat_9_5_0.Xml" )

         if !hb_IsObject( oXml )
            oXml = win_OleCreateObject( "Chilkat_9_5_0.Xml" )
         endif

         if hb_IsObject( oXml )

            oXml:LoadXmlFile( "d:\xml\n1.xml" )

            ? oXml:GetChildContent( "protNFe|infProt|chNFe" )

            ? oXml:GetChildContent( "NFe|infNFe|infAdic|infCpl" )

         endif

      endif

   endif

return

---cut--- 
 


Regards.

Nenad Batocanin

unread,
Mar 25, 2022, 3:46:18 AM3/25/22
to harbou...@googlegroups.com

Hello!

 

Very interesting! Which version should I buy, I don't see the version that is for Harbor?

 

Regards, NB

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/ebc16486-f46f-46ef-8aeb-0ba59f146832n%40googlegroups.com.

Antonio Carlos Pantaglione

unread,
Mar 25, 2022, 6:41:41 AM3/25/22
to Harbour Users
You need activeX version:


regards.

Maurizio la Cecilia

unread,
Mar 25, 2022, 5:59:50 PM3/25/22
to Harbour User Group
Hi Antonio,
thanks a lot, but my customer doesn't want to pay a license.
However your suggestion is much appreciated.
Best regards.
--
Maurizio 

Pierpaolo Martinello

unread,
Mar 26, 2022, 6:38:37 AM3/26/22
to Harbour Users
Hi Maurizio,
you could digitally sign your files with "Arubasign" 
Install the software on your pc (require a smartcard lector and obviously a smart cart with owner certificate)
then call the software with "C:\Users\MCecilia\AppData\Local\ArubaSign\users\apps\ArubaSign64.exe" -s "your file to sign"
The customer must then complete the procedure with the "PIN" etcetera.
Same action is available with DikeGo desktop but i prefere ArubaSign
Ps. i am available on Telegram channel
Spero di essere stato utile
Greetings (also to your new grandson)
Pierpaolo Martinello
IW1CUY Ham Radio From Biella Italy
Linux User 177880  

Maurizio la Cecilia

unread,
Mar 26, 2022, 8:18:56 AM3/26/22
to harbou...@googlegroups.com
Hi Pierpaolo,
thanks a lot!!!

I wasn't aware about ArubaSign CLI...
I think that this way the problem could be solved, mainly if multiple files could be signed with a single authentication.

We're already on the same Telegram group (with Daniele e Federico), thus if you agree we could continue there our discussion.
Have a nice weekend.
--
Maurizio

Nenad Batocanin

unread,
Mar 26, 2022, 10:53:42 AM3/26/22
to harbou...@googlegroups.com

Please send result here.

 

Regards, NB

Itamar Lins

unread,
Mar 26, 2022, 12:39:47 PM3/26/22
to Harbour Users
Hi!
See SEFAZCLASS, to sign XML files Brazilian Gov. electronic invoice...
https://github.com/JoseQuintas/sefazclass/blob/master/source/ze_sefazassina.prg
Via CAPICON...oCert := win_OleCreateObject( "CAPICOM.Certificate" )
Credits !
By, José Quintas

Best regards,
Itamar M. Lins Jr.

d s

unread,
Mar 26, 2022, 1:34:58 PM3/26/22
to Harbour Users
Hi Pierpaolo Martinello,

I have installed ArubSign. 
I placed certification card into smart card reader, as I usually do. 
Then started to sign PDF document. 
On "Complete signature 1" window I got error: "no devices found" ?

Please explain what to do to make ArubaSign can see my smart card.

Thank you,
Simo.

Pierpaolo Martinello

unread,
Mar 27, 2022, 3:04:01 AM3/27/22
to harbou...@googlegroups.com
Hi Simo,
Is installed the Smart card driver?
Usually Bit4Id Is the most applied.
Is Active the Smart card service?
Remember each smart card require 
a dedicated driver, if these conditions
are satisfacts you could read the 
Certificate present inside the smart card
using preference section of arubasign
and if Is All ok you can sign the file.
with gui or cli...

B.R
Pierpaolo

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/mRFNgI_3bDc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/87ea44d6-21cd-4f55-a46c-f73e10c14a55n%40googlegroups.com.

d s

unread,
Mar 27, 2022, 3:51:42 AM3/27/22
to Harbour Users
Hi  Pierpaolo , 

All is OK with my certification card.  I use it for other purposes in past three years.
I have smart card reader. Installed its driver. Also are installed certificates of our national certification authority (.cer files).  I can see my personal certificate, root and intermediate certificates.
I have installed so called middleware for my national certification authority.

All works OK when I sign PDF file with some other apps, say Jsignpdf or  with NexU is an open-source signature tool.

But with ArubaSign I got "no devices found"  on "Complete signature 1" window.

I tried with Preferences and  Card Management, no success, also "No device found" message.

Thank you and Best regards,
Simo.

Giuseppe Bogetti

unread,
Mar 27, 2022, 9:26:12 AM3/27/22
to Harbour Users
Hi Maurizio,
there is also FirmaCerta from Namirial which has a CLI interface. I used it successfully to digitally sign Electronic Invoices and other XML files for AdE

Regards, Giuseppe

Pierpaolo Martinello

unread,
Mar 27, 2022, 10:50:15 AM3/27/22
to Harbour Users
Hi Simo,
Arubasign is dedicated to italian people and usually read the Oberthur smart card but use
Bit4Id interface to read the card.
If Bit4id fail  "No device found" message appair in ArubaSign.
In Italy can be also use other free software as "dike gosign"
and "FirmaOk" By Poste Italiane
But i think that the behavior is the same and dependent on the software driver that
interfaces the smartcard with the microsoft store.

Best Regard
Pierpaolo Martinello
IW1CUY Ham Radio From Biella Italy
Linux User 177880  
Il giorno domenica 27 marzo 2022 alle 09:51:42 UTC+2 cod...@outlook.com ha scritto:

d s

unread,
Mar 27, 2022, 11:08:23 AM3/27/22
to Harbour Users
Thank you  Pierpaolo.
I will try with Bit4ld. 
Meanwhile I tried with  dike gosign and saw that it also requires Bit4ld. ArubaSign is more user friendly.

Best regards,
Simo.
 

Maurizio la Cecilia

unread,
Mar 28, 2022, 4:43:45 PM3/28/22
to harbou...@googlegroups.com
Hi Giuseppe,
thanks.
In effects my client needs Aruba, Dike and FirmaCerta interfaces. It's a financial advisor and it's delegate by his clients.

Tomorrow I'll try to test this three CLI and I'll report here the results.
Best regards.
--
Maurizio
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/d0b2b06f-14d5-4ac1-9f54-f86c5ab667ccn%40googlegroups.com.


Maurizio la Cecilia

unread,
Mar 28, 2022, 6:43:18 PM3/28/22
to Harbour User Group
Hi Nenad,
I can confirm that the suggestion by Pierpaolo Martinello is effective.
Using -s filename as parameters the ArubaSign software takes in charge the document to sign and, moreover, it allows to queue multiple files and sign it later in a single shot.
Next steps will be to test if the same method will work also with more applications (Dike, FirmaCerta, etc.), and mainly with GoSign, a software claiming to be able to drive all the smart card readers, at least in Italy.

Best regards.
--
Maurizio 

Nenad Batocanin

unread,
Mar 28, 2022, 7:10:10 PM3/28/22
to harbou...@googlegroups.com
Message has been deleted

Giuseppe Bogetti

unread,
Mar 29, 2022, 2:39:47 AM3/29/22
to Harbour Users
Hi Maurizio,
from my experience Dike as CLI interface but you can use it only with the paying version. In the free version it is disabled.

Regards Giuseppe
Reply all
Reply to author
Forward
0 new messages