Show / Hide Table of Contents
Edit on GitHub

Ruby on Rails samples project

The Ruby on Rails samples project shows how to use Rest PKI together with Web PKI on a Ruby project using the Ruby on Rails framework. It is hosted on GitHub at:

https://github.com/LacunaSoftware/RestPkiSamples/tree/master/Ruby

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 initializer file restpki.rb
  4. Install dependencies: bundle install
  5. Run application: rails server
  6. Access the URL http://localhost:3000

Project map

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

Authentication with digital certificate

  • Controller: AuthenticationController.rb
  • Views:
    • index.html.erb (JavaScript on signature-form.js)
    • action.html.erb

PAdES signature with file already on server

  • Controller: PadesSignatureController
  • Views:
    • index.html.erb (JavaScript on signature-form.js)
    • action.html.erb

PAdES signature with file uploaded by user

After the file upload (which is crudely implemented merely for demonstration purposes on the controller UploadController and view index.html.erb) 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 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

  • Controller: PadesSignatureWithoutIntegrationController
  • Views:
    • index.html.erb (JavaScript on signature-without-integration-form.js)

Open/validate an existing PAdES signature

Not yet available on this project.

Printer-friendly version

Not yet available on this project.

CAdES signature with file already on server

  • Controller: CadesSignatureController
  • Views:
    • index.html.erb (JavaScript on signature-form.js)
    • action.html.erb

CAdES signature with file uploaded by user

After the file upload (which is crudely implemented merely for demonstration purposes on the controller UploadController and view index.html.erb 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 Co-sign with another certificate is clicked, the same control flow is repeated, but now with the URL parameter userfile filled.

CAdES signature using server key

Not yet available on this project.

Open/validate an existing CAdES signature

Not yet available on this project.

XML signature of the entire document

  • Controller: FullXmlSignatureController
    • index.html.erb (JavaScript on signature-form.js)
    • action.html.erb

XML signature of an element

  • Controller: XmlElementSignatureController
  • Views:
    • index.html.erb (JavaScript on signature-form.js)
    • action.html.erb

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

  • Controller: BatchSignatureController
  • View: index.html.erb (JavaScript on batch-signature-form.js)

Optimized batch of PAdES signatures

Not yet available on this project.

Batch of CAdES signatures

  • Controller: CadesBatchSignatureController
  • View: index.html.erb (JavaScript on batch-signature-form.js)

Batch of XML signatures of elements on the same document

Not yet available on this project.

Back to top Copyright © 2015-2020 Lacuna Software