0

I've found many documents/posts/etc on how to digitally sign a PDF document with PAdeS standard with .NET and iTextSharp but till version 5.x of the library. Now using nuGet it is recommended to use the new version 7 of that library but no document or post is available on that. Trying to adapt the 5.x branch examples brought me to nowhere. The official documents/tutorial/examples are still tied to the old release. I've tried to use the Java exmaple but some classes have no direct relation to the .NET counterpart so I'm stuck. Has someone yet done something with new version?

Thank you.

crick77
  • 65
  • 8
  • There are numerous flavors of PAdES. Do you create a Baseline profile signature? Which profile? Or some Extended profile Signature? Which profile? Or probably a signature according to the profile for CMS signatures in PDF? As you effectively want to port your iText 5 solution to iText 7, you may start by posting your pivotal iText 5 signing code. – mkl May 30 '18 at 16:26
  • Hi, the PAdES versione i'm looking for is the PAdES-BES (or PAdES Part 3) that has validity in my country (Italy) and in the European Community. I have actually no code either in the iText 5 format because I've tried to start directly with the new version (as suggested in the site and nuGet repository). Maybe I will try with the 5 version first. Thank you. – crick77 Jun 04 '18 at 06:00
  • *"Maybe I will try with the 5 version first."* - Your question sounds like you were trying that already. If you don't, I'd suggest using iText 7 (and, if need be, ask some questions here). *"PAdES-BES (or PAdES Part 3) that has validity in my country (Italy) and in the European Community"* - The *PAdES part **n*** profiles (which reference parts of ETSI TS 102 778) have mostly been superseded by profiles from ETSI EN 319 142 part 1 (BASELINE-*X*) and 2 (EXTENDED-*X* and legacy CMS) in the EU. These newer profiles can be considered sub-profiles of the older ones. Any preference among these? – mkl Jun 04 '18 at 10:00
  • Hi, thank you for your reply. First of all I've never tried to sign using version 5. I've just tried to start with version 7 but all examples for digital signature are only available for version 5 so i _really_ don't know how to start. Tried to modifiy the code from some tutorial for version 5 but with no success: some classes have been removed/changed and I haven't find replacement for them, so I'm stuck. Doing a more deep research I need PAdES-BES profile 3 (ETSI TS 102778-3) for Qualified Electronic Signature with SHA-256 hash. – crick77 Jun 07 '18 at 09:56
  • A simple example that take a PDF as input and produces a PDF in output signed using the available smartcard/pin combination is really all that I need to start. Thank you. – crick77 Jun 07 '18 at 09:57
  • Have you tried something along the lines of [this answer](https://stackoverflow.com/a/13361647/1729265) with `CryptoStandard.CADES`? If that works, I'd suggest to use that with some improvements (in particular not to use SHA-1 but instead a member of the SHA-2 and SHA-3 families). – mkl Jul 02 '18 at 09:57

0 Answers0