How to implement digital signature with my existing web project

10,751

Solution 1

The security restrictions of browsers do not allow javascript access to the system certificate keystore or smart cards. Formerly java applets could be used, but with the latest browser updates it is no longer possible.

Current solutions for digital signature in browsers require the installation of a desktop software on the user's computer. The operating process is as follows:

Installation: The user installs the desktop software on his computer. The software installs a self-signed certificate and includes an embedded browser that listens on a computer port and runs it as a service

  1. The web application requests a signature to the local software using a secure web connection. For example https://localhost:1234/sign?doc=xxxx. The browser waits for the result

  2. The local application receives the document, asks the user to select the certificate or enter the card and make the signature. As it is a local application, there are no security restrictions

  3. The web application receives the result. It can query the local application through a REST service or open a websocket.

The concept is simple (a web application that requests the signature to a local application), but the construction of an application of this type is quite complex because you have to take into account many other factors:

  • Software installation and distribution

  • Security and Encryption

  • Digital signature formats: XAdES, CAdES, PAdES etc. They can be implemented in the application or use a signature service in 3 phases, where the documents are on the server and a single hash is signed locally

So I recommend using an existing solution:

  • @firma + Autofirma: Open-source solution promoted and used by the public administration in Spain

  • SD-DSS + nexU(lowina): Open-source solution promoted by the European Commision. Check the demo here

  • chrome token signing: Chrome and Firefox extension for signing with your eID on the web developed for the Estonian government

Sinadura is also an open-source initiative, and from what I've seen it works in a similar way, but I do not know if it has important references and I have not found the API

Solution 2

It is hard to tell what is going to meet your requirements from the high-level you've provided. "Digital signature" is a very broad and generic requirement. Legal digital signatures can be as simple as a text field with specific instructions to users on how to type their conformed signature. And, of course, you can go all the way to signing documents with encrypted certificates.

It sounds like you tried Alfresco and one of the many digital signature add-ons available for it, but you do not want to implement an entire enterprise content management platform just to meet this requirement.

One idea would be to look at a SaaS offering like Docusign or RightSignature.

Another idea would be to develop your own simple service. If the documents you need to sign are PDF, for example, or could be easily converted to PDF, you could use something like the iText PDF API to create digital signatures on PDF documents on the server side.

Solution 3

There is some configuration in Alfresco to create a custom action.

You can create a custom action in alfresco,

And you can execute your java class code to create the digital signature on file.

You can take the reference from this java class

Share:
10,751
Sree
Author by

Sree

Updated on June 25, 2022

Comments

  • Sree
    Sree almost 2 years

    I'm working on the project where the user needs to do a digital signature on a document. I checked in the google and know about sinadura which is a desktop application but I need to invoke this into my web application.

    I installed alfresco community edition on Linux server (https://www.alfresco.com/thank-you/thank-you-downloading-alfresco-community-edition) and followed the instruction as below GitHub link.

    https://github.com/zylklab/alfresco-sinadura

    I've implemented successfully with above instructions. But Alfresco is the big project and given several other features too. But I don't need that and I just need to implement digital signature part into my own web application similar to alfresco

    How to implement the digital signature part in my existing project? Can anyone please give a suggestion