How to sign a PDF in Android
Asked Answered
L

1

9

I have to implement in an Android application a function that allow me to sign a PDF, when i say "sign" I mean the digital signature (First and second name) affixed to the end of the document from the user.

I have access to a Samsung Note 4 (with stylus) then it would not be a problem, "write" on the display.

The question is: there is the possibility to sign a document using some library like itext or I must write a custom function ?

Luculent answered 7/11, 2016 at 9:33 Comment(7)
What you describe does not seem to be a "digital signature" but rather just an image attached to the document. This is extremely easy to forge and does not really count as a signature.Ferrari
I only need a sign (first name and last name) at the end of the document, what is the best way for you ?Luculent
Your question text and tags indicate digital-signature which uses cryptography and usually is backed by a PKI and backed by certificates from a CA. Then you say you "only need a sign (first name and last name)". Do you mean by that including a graphic showing something akin to an ink signature? And is that graphic intended as visualization of the cryptographic signature or do you actually not mean a digital signature at all?Brawl
@Brawl I need an electronic signature, I have no idea to how I can do this, but I need that users can sign a documentLuculent
"Electronic signature" is a pretty fuzzy term. Just consider the UETA Sec 2 definition: "Electronic signature" means an electronic sound, symbol, or process attached to or logically associated with a record and executed or adopted by a person with the intent to sign the record - when you say you need an electronic signature, do you mean you need some such sound? (And that is but one of many legal and scientific definitions, and marketing divisions add their own variations thereof.) So please decide first what flavor of "electronic signature" you need and implement it as a second step.Brawl
When you go to a bank rate a withdrawal, you have to sign a document via a graphics tablet, how you define the signature that you set on his pad? I simply need to sign a PDF with my "electronic sign", understand ?Luculent
That tablet and the whole solution it is part of is specially certified to guarantee that misuse cannot easily be claimed. If you can spend some tens of thousands of bucks on such a certification, that's OK. Alternatively, if you don't care about refuted signatures, that's OK, too. In the latter case you merely need to capture the user's signature as an image and add that image to the pdf. For either task there are libraries or APIs.Brawl
B
18

I guess you want to apply an electronic signature on a document using a user's handwriting with a pen. As has said @mkl, 'digital signature' concept is usually applied when using digital certificates and cryptography.

Handwritten electronic signature requirements

People tend to think that the handwritten signature consists of embedding an image, but so that your system has a minimum legal value in case of litigation you will need:

  • R1 - ensure the identity of the signer

  • R2 - Uniquely attach signature and document

  • R3 - protect integrity of document and signature

More or less these are the characteristics of digital signatures.

Handwritten signature on Android

The process on android should be like this:

  • R2) capture the user graph including biometrics(x,y,time,pressure) using a Canvas. Embed image and biometrics data into document using PDFBox or itext (client or server side)

  • R1) included biometric data in previous step allows a potential analysis of signature by an expert

  • R3) I suggest to apply a timestamp over document and signature evidences to protect the integrity and ensure the time of signature. Both itext and PDFBox support it

If you do not need legal value, then apply only the drawing part. The quality of your signature will be determined by the devices characteristics. For example a specific signature tablet can provide also the orientation of the pen

Android links

You will find similar links for itext. Select the most suitable for your use case and whether you want to execute on Android or in the server side

Baba answered 14/11, 2016 at 21:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.