Signing PDFs and Timestamps (reloaded)

Discussions about PDF management.
rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Tue May 02, 2017 5:58 pm

Hi,

I'm in a similar position than in the previous topic, with some improvments.

My customer got a SIM Card with a RCS** certificate, and I'm successfully signing the document with it with gdpicturepdf (SigSetCertFromSmartCardBySerialNumber)
Now, I've a timestamp server, which provide me a RFC3161 digital timestamp of the hashed file.

How can I mix theses two using gdpicturepdf ?
Thanks !

delbeke
Posts: 90
Joined: Wed Oct 31, 2012 5:07 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by delbeke » Wed May 03, 2017 10:12 am

Hi rlagrange.
At this time, there is no way to Time Stamp.
Time Stamping in curently on developpement.
I hope to have a working build in one month or less.

Best regards.
Jean-Luc

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Thu May 04, 2017 10:19 am

Hi Jean-Luc,

That's a great news !
Thanks for the follow up, and please alert me when it's ready !

Regards,
Romain Lagrange

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Wed May 10, 2017 12:00 am

Hi,

Regarding the recent release of GdPicture 14, will this feature be available as a "14.1" release, or will it be released in 15 only ?

Thanks.

delbeke
Posts: 90
Joined: Wed Oct 31, 2012 5:07 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by delbeke » Wed May 10, 2017 10:20 am

Hi rlagrange.

We have made the functions and we are currently in the beta.
I supposed the 14.1 version will include them, at least vers 14.2

Jean-Luc

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Sun Jul 23, 2017 3:32 pm

Hi Jean-Luc,

Did you have a release date for this feature ?

Thanks,
Romain Lagrange

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Fri Jul 28, 2017 2:32 pm

Hi,
I'm sorry to insist, by I have a demo scheduled for mid september, and I have to know if this feature could be developed in time (if so, I have to get a working build of gdpicture some time before).
Regards,
Romain Lagrange

delbeke
Posts: 90
Joined: Wed Oct 31, 2012 5:07 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by delbeke » Fri Jul 28, 2017 5:17 pm

Hi

The feature will be avaible in the month(August).

Best regards

Jean-Luc

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Mon Jul 31, 2017 8:25 pm

Thanks

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Thu Aug 31, 2017 5:13 pm

Hi,
Did you have a more precise release date ?
Is it possible to have a working beta build ?
Thanks.

User avatar
Loïc
Site Admin
Posts: 5575
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Signing PDFs and Timestamps (reloaded)

Post by Loïc » Fri Sep 01, 2017 6:40 pm

Yes, the feature should be ready within a couple of weeks. A guy from our team will contact you to obtain a beta asap.

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Tue Sep 12, 2017 2:48 pm

Still waiting.
No need to worry anymore, it's too late for implementing it before the scheduled demo.

Gabriela
Posts: 37
Joined: Wed Nov 22, 2017 9:52 am

Re: Signing PDFs and Timestamps (reloaded)

Post by Gabriela » Wed Nov 22, 2017 12:47 pm

Hi,
the feature is already implemented (updated and renewed). Here you can find a code snippet based on GdPicture.NET 14:

How to digitally sign or certify PDF documents
http://guides.gdpicture.com/content/web ... ents.html
Kind regards,

Gabriela
GdPicture Team

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Wed Nov 22, 2017 9:41 pm

Thanks.

I have another issue with this version.

I have a feature : "simple protection", wich sign the document with a self generated certificate.
This is just to prevent further modification of the document, and don't authenticate the issuer.

This was working fine in 14.0.22, but no more since 14.0.25. A first chance exception say : The key didn't exist

Stacktrace =
System.Security.Cryptography.CryptographicException : 'La clé n’existe pas.'
mscorlib.dll!System.Security.Cryptography.Utils.GetKeyPairHelper(System.Security.Cryptography.CspAlgorithmType keyType, System.Security.Cryptography.CspParameters parameters, bool randomKeyContainer, int dwKeySize, ref System.Security.Cryptography.SafeProvHandle safeProvHandle, ref System.Security.Cryptography.SafeKeyHandle safeKeyHandle) Inconnu Aucun symbole n'a été chargé.
mscorlib.dll!System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() Inconnu Aucun symbole n'a été chargé.
mscorlib.dll!System.Security.Cryptography.RSACryptoServiceProvider.RSACryptoServiceProvider(int dwKeySize, System.Security.Cryptography.CspParameters parameters, bool useDefaultKeySize) Inconnu Aucun symbole n'a été chargé.
GdPicture.NET.14.dll!gdpicture_ហ.gdpicture_ᜀ(System.Security.Cryptography.RSACryptoServiceProvider A_0) Inconnu Aucun symbole n'a été chargé.
GdPicture.NET.14.dll!gdpicture_ហ.gdpicture_ᜀ(byte[] A_0, Org.BouncyCastle.X509.X509Certificate[] A_1, System.Security.Cryptography.X509Certificates.X509Certificate2 A_2, Org.BouncyCastle.Crypto.AsymmetricKeyParameter A_3, Org.BouncyCastle.Asn1.Asn1EncodableVector A_4, out byte[] A_5, GdPicture14.PdfSignatureMode A_6, GdPicture14.PdfSignatureHash A_7) Inconnu Aucun symbole n'a été chargé.
GdPicture.NET.14.dll!gdpicture_ឡ.gdpicture_ᜀ(gdpicture_ᠹ A_0, GdPicture14.PdfSignatureMode A_1, bool A_2) Inconnu Aucun symbole n'a été chargé.
GdPicture.NET.14.dll!gdpicture_១.gdpicture_ᜀ(string A_0, GdPicture14.PdfSignatureMode A_1, bool A_2) Inconnu Aucun symbole n'a été chargé.
GdPicture.NET.14.dll!GdPicture14.GdPicturePDF.ApplySignature(string OutputFileName, GdPicture14.PdfSignatureMode SignatureMode, bool Linearisation) Inconnu Aucun symbole n'a été chargé.

The certificate source was set using :
status = oGdPicturePdf.SetSignatureCertificateFromP12(new MemoryStream(Properties.Resources.pfxcodesign), "mypassword");
and status was OK.

The generated cert is generated for visual studio strongnaming, so it's not a "signature" cert.
Again, this was working in 14.0.22. Is this change wanted ?

rlagrange
Posts: 25
Joined: Tue May 02, 2017 5:51 pm

Re: Signing PDFs and Timestamps (reloaded)

Post by rlagrange » Thu Nov 30, 2017 5:01 pm

Solved with the support.
For further readings : my certificate only allow SHA1 signatures.
As SHA256 is now the default algorithm (or maybe there was an automatic detection ?), you should now set the correct signature algorithm using :
oGdPicturePdf.SetSignatureHash(PdfSignatureHash.SHA1);

As I didn't find a way to detect what could work with the current certificate, I ended using a try/change/retry code :
- ApplySignature
- if not OK, SetSignatureHash(PdfSignatureHash.SHA1);
- ApplySignature again
...

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest