Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see Digital Signatures in PDF files using objective C

I have a PDF viewer in my app. I am simply loading the PDF file into a UIWebView. But when the PDF contains digital signature, it is not displayed in WebView. All other content of the PDF is displayed. Only signature area is left blank. I checked with the Preview, and Safari in OSX also, and the result is the same.

Then I downloaded the Adobe Reader app for Mac, and tried to open the PDF. It displayed the signature correctly!!

Can anybody tell me whether there is any mechanism in objective C, to display the signature of PDF files.

like image 701
Shine Kumar Avatar asked Nov 12 '12 06:11

Shine Kumar


People also ask

How do I view a digital signature in PDF?

Click on the Signature Properties button to check signature properties. In the signature Properties window click Show Signers Certificate button. Following screen will be displayed once you click on it. Initially you will get the summary of the Digital Signature in the certificate viewer window.

Is digital signature visible in PDF?

Instead the digital signature can be viewed by opening the PDF in Adobe Reader, Adobe Acrobat or another PDF editing application, and clicking on the Signatures tab which can usually be seen on the left-side of the application.

How do I view an electronic signature?

Click File > Info > View Signatures. In the list, on a signature name, click the down-arrow, and then click Signature Details. In the Signature Details dialog box, click View.


1 Answers

Adobe documents how to use Digital Signatures in PDF files. See section 12.8, page 466 of the Adobe PDF 1.7 spec.

However, as you've discovered, many viewers of pdf files, including the pdf viewer built into Google Chrome ignore Digital Signatures. This is rather unfortunate as Digital Signatures become more popular.

If you haven't done so yet, file a bug report against the UIWebView. Or a feature enhancement request. It is non-trivial to add full Digital Signature support, but it's a great feature.

Adding Digital Signature Support

As a first step of support, you could consider just showing the information about the document's Digital Signatures and verifying them. -- it is important not just to show Digital Signatures, you also need to verify them.

Most important part of verification, imho, is to verify that the document was not changed since it was signed. Verifying that you trust the root cert of the signer's cert is good to do but, in practice, is not as important as doc integrity. On the other hand, it all depends on your app and its environment.

As a second step, you could show the graphical signature that is often included with the Digital Signature(s) at the right spot on the document's page(s).

It is common for a pdf to include multiple Digital Signatures. It is also common for a pdf to included multiple "electronic signatures" along with a verifying Digital Signature.

An "Electronic Signature" is merely a graphical signature shown on a page of the pdf. It does not involve any cryptographic functions, does not assure document integrity, nor signer non-repudiation (no signer certs are involved).

Because Digital Signatures take real time to verify, pdfs sometimes include multiple electronic signatures, eg as initials on each page. And then a single Digital Signature to cover the entire document.

like image 97
Larry K Avatar answered Nov 10 '22 00:11

Larry K