PHP sample application for signing on web applications with the ID-card and Mobiil-ID

This library enables using DigiDocService from PHP applications without sending datafile contents to the Service. DDOC/BDOC container is transformed to hashcode format before sending it to the service. Read more about DigiDocService hashcode format in DigiDocService specification chapter Hashcode

The new library is downloadable here (ver 1.1.4)

Sample application you can see here

The download package includes documentation and sample application of the PHP hashcode library. It is created to demonstrate the ability of DigiDocService to add signature (with ID-card and Mobiil-ID), remove signature, add datafile, remove datafile and do verification of a document without actual datafiles. For configuring details, please read example /_README.txt file in the download package.

VersionPublishedRelease notes
  • Fixed the issue where during signing DDOC format disappeared element xmlns from DataFile tag (DDS-1804)
  • In DDOC format the length of the rows of the datafile in base64 is 64-symbols (DDS-1805)
  • Fixed bug that caused changing signatures invalid when DigiDoc container contained unusual presentation of datafile (for example missing line breaks in base64 content) (DDS-1771)
  • hwcrypto.js library upgraded to the version 0.0.10
  • Code and application building restructured component is used instead of old idCard.js. Now signing with smart card works also Chrome 42 and newer versions.
  • Updated the documentation
  • Added DIGIDOC-XML 1.1 ja DIGIDOC XML 1.2 files public beta release


The online signing hwcrypto.js componenthas been used in the sample application.

More information regarding the sample application can be found at TEST-DigiDocService usage instructions.

In order to test the sample application, the signature certificate of a real ID-card, digi-ID or a test ID-card should be registered in the TEST service database. To do this the certificate should first be saved from the ID-card (digi-ID) to your computer with the help of the ID-card Utility and then uploaded to the testing environment in the .pem format.

Also possible to use with live Mobile-ID. In order to do so you need to upload your mobile-ID certificates to TEST service database.


If you didn't find an answer to your question, send it to our team.

  • See instructions
  • Please estimate your ability to use the computer, so that we can provide you with the best guidance


  • Verification failed

How can we improve the article and be more helpful?
Send Close