Show / Hide Table of Contents
Edit on GitHub

ASP.NET Core samples project

The ASP.NET Core samples project shows how to use Rest PKI together with Web PKI on a project using the new ASP.NET Core technology. It is hosted on GitHub at:

https://github.com/LacunaSoftware/RestPkiSamples/tree/master/CSharp/AspNetCore

Running the project

  1. Download the project or clone the repository
  2. Open the project folder (CSharp\AspNetCore)
  3. Open the solution file (.sln) on Visual Studio
  4. Generate an API access token on the REST PKI website
  5. Paste your access token on the file web.config
  6. Run the solution. Make sure your system allows automatic Nuget package restore (if it doesn't, manually restore the packages).

Project map

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

Authentication with digital certificate

  • API Controller: AuthenticationController
  • SPA Controller: authentication.js
  • SPA Template: authentication.html

PAdES signature with file already on server

  • API Controller: PadesSignatureController
  • SPA Controller: pades-signature.js
  • SPA Template: pades-signature.html

PAdES signature with file uploaded by user

After the file upload (which is crudely implemented merely for demonstration purposes on the SPA controller upload.js, template upload.html and API Controller UploadController) 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

This feature is demonstrated as an optional configuration on the PAdES signature with file already on server sample which by default starts commented out. To enable it, uncomment the following line on PadesSignatureController:

signatureStarter.PdfMarks.Add(PadesVisualElements.GetPdfMark(storage, 1));
Tip

Try changing the argument to the GetPdfMark(int) method to see different PDF mark configurations

The relevant code is on the class PadesVisualElements, method GetPdfMark(int).

PAdES signature using server key

Not yet available on this project.

PAdES signature without client communication

Not yet available on this project.

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

  • API Controller: CadesSignatureController
  • SPA Controller: cades-signature.js
  • SPA Template: cades-signature.html

CAdES signature with file uploaded by user

After the file upload (which is crudely implemented merely for demonstration purposes on the SPA controller upload.js, template upload.html and API Controller UploadController) 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 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 cmsfile 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

Not yet available on this project.

XML signature of an element

  • API Controller: XmlElementSignatureController
  • SPA Controller: xml-element-signature.js
  • SPA Template: xml-element-signature.html

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

Not yet available on this project.

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