Show / Hide Table of Contents
Edit on GitHub

PHP 5.2 samples project

The PHP 5.2 samples project shows how to use Rest PKI together with Web PKI on a project using PHP 5.2. It is hosted on GitHub at:

https://github.com/LacunaSoftware/RestPkiSamples/tree/master/PHP/legacy52

Note

Only use this project if you cannot use the PHP 5.5+ samples project nor the PHP 5.3/5.4 samples project.

Running the project

  1. Download the project or clone the repository
  2. Generate an API access token on the REST PKI website
  3. Paste your access token on the file PHP/legacy52/config.php
  4. In a command prompt, navigate to the folder PHP/legacy52 and run the command composer install to download the dependencies (if you don't have Composer installed, get it here)
  5. Setup a website on your local HTTP server pointing to the PHP/legacy52 folder
  6. Open the index.php file on the browser on the corresponding URL (depending on the previous step)

Project map

This section lists where to find the relevant parts in each feature sample on the project.

Authentication with digital certificate

  • authentication.php
    • JavaScript: (inside authentication.php)
  • authentication-action.php

PAdES signature with file already on server

  • pades-signature.php
    • JavaScript: (inside pades-signature.php)
  • pades-signature-action.php

PAdES signature with file uploaded by user

After the file upload (which is crudely implemented merely for demonstration purposes on upload.php) is done the control flow is the same as in the sample PAdES signature with file already on server, but with the URL parameter userfile filled.

PAdES co-signature

After the control flow of the sample PAdES signature with file already on server is completed and the link Click here to co-sign with another certificate is clicked, the same control flow is repeated, but now with the URL parameter userfile filled.

PAdES marks

Not yet available on this project.

PAdES signature using server key

Not yet available on this project.

PAdES signature without client communication

Not yet available on this project.

Open/validate and existing PAdES signature

  • open-pades-signature.php

Printer-friendly version

Not yet available on this project.

CAdES signature with file already on server

  • cades-signature.php
    • JavaScript: (inside cades-signature.php)
  • cades-signature-action.php

CAdES signature with file uploaded by user

After the file upload (which is crudely implemented merely for demonstration purposes on upload.php) is done the control flow is the same as in the sample CAdES signature with file already on server, but with the URL parameter userfile filled.

CAdES co-signature

After the control flow of the sample CAdES signature with file already on server is completed and the link Click here to co-sign with another certificate is clicked, the same control flow is repeated, but now with the URL parameter cmsfile filled.

CAdES signature using server key

Not yet available on this project.

Open/validate an existing CAdES signature

  • open-cades-signature.php

XML signature of the entire document

  • xml-full-signature.php
    • JavaScript: (inside xml-full-signature.php)
  • xml-full-signature-action.php

XML signature of an element

  • xml-element-signature.php
    • JavaScript: (inside xml-element-signature.php)
  • xml-element-signature-action.php

XAdES signature of an element

Not yet available on this project.

Open/validate signatures on an existing XML file

Not yet available on this project.

Batch of PAdES signatures

  • batch-signature.php
    • JavaScript: batch-signature-form.js
    • AJAX handlers: batch-signature-start.php and batch-signature-complete.php

Optimized batch of PAdES signatures

Not yet available on this project.

Batch of CAdES signatures

Not yet available on this project.

Batch of XML signatures of elements on the same document

Not yet available on this project.

Back to top Copyright © 2015-2020 Lacuna Software