---
title: "Using PKI Express on Java"
description: "Using PKI Express on Java with the Spring MVC samples project on GitHub, which also uses Web PKI, and ways to run it, such as Gradle."
canonical: "https://docs.lacunasoftware.com/en-us/articles/pki-express/java"
locale: "en"
product: "PKI Express"
last_updated: "2026-10-12"
---

# Using PKI Express on Java

This articles describes how to use [PKI Express](https://docs.lacunasoftware.com/en-us/articles/pki-express) on Java

## Samples project

The samples project shows the usage of PKI Express together with the [Web PKI](https://docs.lacunasoftware.com/en-us/articles/web-pki) browser component
on a **Java 7+** web application (including 8 and 9) using the [Spring MVC](http://spring.io/) framework. It is hosted on GitHub:

https://github.com/LacunaSoftware/PkiSuiteSamples/tree/master/java/springmvc

> **Note**
>
> If you are using a previous version of Java, please [contact us](https://www.lacunasoftware.com/en/home/purchase).

### Running the project

To run the project, it's necessary to have the Java Development Kit installed. You can use the following tools:

**Using Gradle**

1. [Install PKI Express](https://docs.lacunasoftware.com/en-us/articles/pki-express/setup)

1. [Download the project](https://github.com/LacunaSoftware/PkiSuiteSamples/archive/master.zip) or clone the [repository](https://github.com/LacunaSoftware/PkiSuiteSamples.git)

1. In a command prompt, navigate to the folder `java/springmvc` and run the command `gradlew bootRun` (on Linux `./gradlew bootRun`).
   If you are using Windows, you can alternatively double-click the file `Run-Sample.bat`

1. Once you see the message "Started Application in x.xxx seconds" (the on-screen percentage
   will *not* reach 100%), open a web browser and go the URL http://localhost:60695/

> **Note**
>
> If you are on Linux, you may have to add the execution permission to *gradlew* file by executing the command `chmod +x gradlew`.

**Using Maven**

1. [Install PKI Express](https://docs.lacunasoftware.com/en-us/articles/pki-express/setup)

1. [Download the project](https://github.com/LacunaSoftware/PkiSuiteSamples/archive/master.zip) or clone the [repository](https://github.com/LacunaSoftware/PkiSuiteSamples.git)

1. In a command prompt, navigate to the folder `java/springmvc` and run the command `mvn spring-boot:run`. To run the command, it's 
necessary to have the Apache Maven installed.

1. Once you see the message "Started Application in x.xxx seconds" (the on-screen percentage
   will *not* reach 100%), open a web browser and go the URL http://localhost:60695/

## Maven package

In order to use PKI Express on Java you must include the Maven package [pki-express](https://search.maven.org/artifact/com.lacunasoftware.pkiexpress/pki-express)

If your project uses **Maven**, add this to your `pom.xml`:

```xml
<dependencies>
	...
	<dependency>
		<groupId>com.lacunasoftware.pkiexpress</groupId>
		<artifactId>pki-express</artifactId>
		<version>1.23.1</version>
	</dependency>
	...
</dependencies>
```

If your project uses **Gradle**, add this to your `build.gradle`:

```groovy
repositories {
	mavenCentral()
} 

dependencies {
	implementation 'com.lacunasoftware.pkiexpress:pki-express:1.23.1'
}
```

The package is open-source, hosted on [GitHub](https://github.com/LacunaSoftware/PkiExpressJava). Feel free to fork it if you need to make any customizations, and even submit and *pull request*.

## See also

* [Signature sample explained](https://docs.lacunasoftware.com/en-us/articles/pki-express/java/how-it-works)

**Demos and samples**

- Sign a PDF with PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/PadesSignatureExpressController.java)
- Sign multiple PDFs with PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/BatchPadesSignatureExpressController.java)
- Sign a PDF with a server key using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/PadesServerKeyExpressController.java)
- Sign a file with CAdES using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/CadesSignatureExpressController.java)
- Sign multiple files with CAdES using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/BatchCadesSignatureExpressControler.java)
- Merge CMS/CAdES signatures using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/MergeCadesExpressController.java)
- Validate a signed PDF using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/OpenPadesExpressController.java)
- Validate a CMS/CAdES signature using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/OpenCadesExpressController.java)
- Authenticate with a digital certificate using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/AuthenticationExpressController.java)
- Sign a medical prescription (Receita Simples) using PKI Express: [Java](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/ReceitaSimplesExpressController.java)
