1

Goal

I'm developing an iOS app (Swift) that will digitally sign PDF files. The following steps explain what it needs to do and how it will be used:

  1. The user will open a PDF with my app.
  2. My app will send a digest (SHA-256) of that PDF to a signature server.
  3. The signature server will sign the digest and return a PKCS#7 signature.
  4. My app has to embed the returned signature into the PDF.

In short, I need an iOS library that can embed a PKCS#7 digital signature into a PDF file. Please see detailed requirements below.

Requirements

  1. It needs to be a free library with license that enables usage on commercial products (my client doesn't want to buy a commercial solution).
  2. It needs to work on iOS platform.
  3. To be able to successfully sign a PDF, it has to:
    1. Generate the signature field on PDF.
    2. Generate the signature dictionary (generate PDF object and define byte range).
    3. Embed the PKCS#7 signature into the signature dictionary.

What I have tried

I found some commercial libraries that do what I need, like:

And other commercial libraries that aren't native to iOS, but I can bridge with:

And also libraries that doesn't work on iOS environment:

Besides that, I came across many documentations explaining the theoretical part of PDF signing and PDF in general:

2
  • If you are already involving the server, why not have the server do everything related to the signing? – Ryan Aug 13 '18 at 20:11
  • @Ryan For performance reasons. My client doesn't want to upload the PDF to the server and, after the signing, to download the signed PDF back to the device. – Marcos Tanaka Aug 13 '18 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.