Welcome! Log In Create A New Profile

Advanced

[WDXX] PDFSign

Posted by Michael Drechsel 
[WDXX] PDFSign
September 05, 2020 08:41AM
Hi,

has anybody used PDFSign ever before ?

And if Yes, which certificate has you used ? So far I can see all certificates which Adobe accepts come with a token and the user must type a password before he can use it. I need as for a windows service (without User Interface of course).

regards Michael

regards Michael
Re: [WDXX] PDFSign
September 07, 2020 05:21PM
Hi:

I use a .pfx file with a password and I have a specific path.
From the application I do:

pdfSig is pdfSignature;
pdfSig..Certificate = CertificateLoad("C:\\certificates\\certifFile.pfx", "myPassword")[1];
// --- Rest of propertyes.
PDFSign("MyFile.pdf", pdfSig);

Best regards.
pao
Re: [WDXX] PDFSign
September 07, 2020 05:34PM
I have used it without problems in WX, the problem is the certificate used.
If you use advance certificates you don't need to use PIN, if you use qualified certificates (normally in USB or card) you need to use the PIN.

In my country (Portugal) the advanced certificates will be discontinued at the end of the year,. The CAs will only isue qualified certificates.

I never tested but it's possible to use qualified cedrtificates in the cloud.
The API is defined in the Cloud Signature Consortium site (https://cloudsignatureconsortium.org/)

If you test the use of certificates with the CSC API in the future please share your findings.

I oppened one post at the beginning of the year regarding the use of the CSC API but i didn't receive any reply
[www.wxforum.info]

Regards

Paulo Oliveira



Edited 3 time(s). Last edit at 09/08/2020 06:28PM by pao.
Re: [WDXX] PDFSign
September 08, 2020 07:47AM
Hi Paulo,

many thx for your reply.

One Question:

As far I can see, anything at [cloudsignatureconsortium.org] is in test mode ? Or is it possible to use it now ?
Where can I buy the cerificates or is it free ? But I can´t see where I can put a request for a certificate.

regards Michael
pao
Re: [WDXX] PDFSign
September 08, 2020 10:54AM
Hi Michael,
As far as i know you can use it in production with almost every CA, just ask before you buy the certificate.
we buy the certificates to sign the invoices. If it's a self-signed certificate you don't have tihs problem.
With the free CA like letsencrypt and so on i don't know how it works and if it's possible to issue certificates to sign documents.

Regards

Paulo Oliveira
Re: [WDXX] PDFSign
September 08, 2020 11:08AM
Hi,

In our company we use the SafeNet eToken 5110 (usb) to sign the documents with JsignPdf software to do the job.
Is it possible to use it with WD sign functions?
If yes how can be done?

Regards

Vassilis Boutsikas
pao
Re: [WDXX] PDFSign
September 08, 2020 11:41AM
WD- Yes - Check this help pages
[doc.windev.com] [doc.windev.com] [doc.windev.com]
WB - ???? - The USB dongle must be in the server and i don't know if it's possible to select the correct certificate, certificateselect can't be used.
WM - No

Regards

Paulo Oliveira
Re: [WDXX] PDFSign
September 08, 2020 11:47AM
Hi Paulo,

Thank you for the help. I asked this because some months ago, I asked PCsoft for the same thing and they answered to me that is not possible.
As you can undestrand I'm confused...

Regards

Vassilis Boutsikas
pao
Re: [WDXX] PDFSign
September 08, 2020 12:17PM
In potugal we have to sign all the invoices and we do it in windev without problems. We use one signture control but we have tested the pdfsign function and it works as well,
We are still using advanced certificates (no need of PIN and USB token) but we must change to the qualified ones.until June/2021

In attach is one pdf signed with the pdfsign and the code used to test was:
mycert is Certificate
arrCertificate is array of Certificates
arrCertificate = CertificateLoad("C:certs\invoice_cert.pfx","xxxxxxxxxxxxxxx")
mycert = arrCertificate[3]
IF mycert..Name = "" THEN
Info("You must select one certificate.")
RETURN
END
IF mycert..ValidForSignature = False THEN
Info("The selected certificate cannot be used to generate a signature.")
RETURN
END
MySignature is pdfSignature
MySignature..Certificate = mycert
MySignature..Caption = "Signed by "+mycert..Name+" Issuer "+mycert..Issuer+" SerialNumber "+mycert..SerialNumber
MySignature..X=1
MySignature..Y=1
MySignature..Width=200
MySignature..Height=5
IF NOT PDFSign(CompleteDir(fExeDir())+"TST_PDF_SIGN.PDF", MySignature) THEN
Info("Error in PDFSign",ErrorInfo())
RETURN
END

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 09/08/2020 12:23PM by pao.
Attachments:
open | download - TST_PDF_SIGN.PDF (15.6 KB)
Re: [WDXX] PDFSign
September 08, 2020 12:29PM
Dear Paulo,

Thank you for the code.

The SafeNet eToken 5110 uses qualified certificates and we use password.
So, as I can understand the CertificateLoad / CertificateSelect will work (correct me if I'm wrong).
In this case the certificate *.pfx file is still located in the disk?

Regards

Vassilis Boutsikas
pao
Re: [WDXX] PDFSign
September 08, 2020 12:38PM
No. The certificate is not on disk when using the USB token.
To use the USB token just use the CertificateSelect function instead of the CertificateLoad, We tested in windows 10 with one USB token and it works.
[doc.windev.com]

We are using the advanced certificates because we need to generate the invoices and send it by email in the server and not in the PC, The invoices are generated by one service and sent over night. The USB token is not an option for us.

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 09/08/2020 12:39PM by pao.
Re: [WDXX] PDFSign
September 08, 2020 12:48PM
Paulo,

One last question.

How I can use the Password?

Regards

Vassilis Boutsikas
pao
Re: [WDXX] PDFSign
September 08, 2020 12:55PM
In our tests with the USB token the only thing we have to use was the PIN and when you select the certificate to use from the list presented by the certificateselect the OS asks for it.

PS: the test was done several months ago and my memory isn't as good as it was. test it yourself, my answer can be wrong.

Regards

Paulo Oliveira
Re: [WDXX] PDFSign
September 08, 2020 12:58PM
Dear Paulo,

Thank you very very much for the huge help.
You make my day with your clarified and detailed info.

Best Regards

Vassilis Boutsikas
Re: [WDXX] PDFSign
September 08, 2020 01:54PM
Hi Paulo,

mhh, I am a little bit confused.

What I have done till now:

1. Buy a certificate from any CA
2. Downloaded it and save it on my disk
3. Use PDFsign with this certificate
4. It Works, but Adobe says "Some certificates must checked" because my certificate is not a qualified or advanced certificate and Adobe and other PDF Viewer don´t trust them

If I understand your post right I have now to do:

1. Buy a certificate from any CA and ask them if they has heard from CSC ever before and provide the API ?
2. Use the CSC Api to sign the pdf
3. Adobe and other trust them now ?

Its so correct ?

regards Michael
pao
Re: [WDXX] PDFSign
September 08, 2020 03:42PM
Yes, you are correct.
Must of the CA provide their own solution and API to sign documents using some middleware.
I'm refering the CSC API because it's suposed to be a standard/open solution.
You can see in this CA (we use their certificates) site that they provied qualified certificates for invoice and other pdf signing in 3 ways,

[www.multicert.com]

Regards

Paulo Oliveira
Re: [WDXX] PDFSign
September 08, 2020 06:06PM
Thx Paulo.

Now I understand.

regards Michael
Re: [WDXX] PDFSign
September 09, 2020 07:14AM
Dear Paulo,

I tested the CertificateSelect() in Win10, but the OS did'nt asked for the PIN when I selected the certificate.
What am I missing ?

Regards

Vassilis Boutsikas
pao
Re: [WDXX] PDFSign
September 09, 2020 05:42PM
I really don't know.
I don't have access to the USB token to test it again because i'm working from home and the USB token is at the office.
Unfortunatly our office is closed and i don't know when it will reopen.

Sorry

Regards

Paulo Oliveira



Edited 2 time(s). Last edit at 09/14/2020 01:45PM by pao.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: