PDF Digital Signature in PowerBuilder

Ramón San Félix Ramón
CODE AUTHOR
Posts: 35
 2 years 9 months ago #431 by Ramón San Félix Ramón
Ramón San Félix Ramón created the code: PDF Digital Signature in PowerBuilder
I have created a NetCore library called NetPdfService, which uses the iTextSharp library to digitally sign PDF files.

In short, the only thing that interests us are the two of_sign methods of the nvo_pdfservice class that allow us to digitally sign the pdf. The difference between both methods is that one uses an image to sign visually and the other does not.

The visual signature could be previously captured with a digital tablet, but I have not developed that in this example.

So that the example can be tested, I have added a test digital certificate called firma.pfx.

Attached PowerBuilder project and SnapDevelop projects of the C# libraries.

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

Ramón San Félix Ramón
CODE AUTHOR
Posts: 35
 17 hours 31 minutes ago #599 by Ramón San Félix Ramón
Ramón San Félix Ramón replied the code: PDF Digital Signature in PowerBuilder

Sorry, but I'm not very familiar with certificates...

Please Log in or Create an account to join the conversation.

ritesh desai
Posts: 1
 3 days 10 hours ago #598 by ritesh desai
ritesh desai replied the code: PDF Digital Signature in PowerBuilder

Hi, Your example work fine , Thank you! Here I have a resquest, Can you add function for get digital certificate from HSM or smartcard? I am not familiar with c#

Regards

Please Log in or Create an account to join the conversation.

Ramón San Félix Ramón
CODE AUTHOR
Posts: 35
 3 days 16 hours ago #597 by Ramón San Félix Ramón
Ramón San Félix Ramón replied the code: PDF Digital Signature in PowerBuilder

Hi David, 

 

In the Open event of the application object, you have the development path. I imagine you ran the program from the IDE, and the path is set to my development environment at the time:

 

ls_path="C:\project pw2021\Blog\pdfsignV\pdfsign.exe"

 

The condition above must also be consistent with the version of the IDE: 

 

if right(UPPER(ls_path), 9)="PB210.EXE" then ---> This is for pb2021

 

I leave here attached the same example migrated to pb2022 3356 since to see it I had to increase the version.

 

By the way, I'll put the development path in the ini file so that it's more intuitive to change it:

 

ls_path = trim(ProfileString(".\pdfsign.ini",  "INICIO", "DevelopmentPath", "C:\projecto pw2021\Blog\pdfsignV"))

 

And I'll update the condition mentioned before to pb2022:

 

if right(UPPER(ls_path), 7)="220.EXE" or right(UPPER(ls_path), 7)="X64.EXE" then

 

Regards... Ramón

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.