This folder contains Java sample projects demonstrating the usage of Lacuna Software's PKI Suite.
For other languages, please visit the repository root.
A sample for a Java web application using the Spring Boot framework can be found in the folder springmvc. The sample uses spring boot to provide a self-contained web application, not requiring a web server installed. The only requirement is having a JDK installed.
To run, you can use the following tools:
Using Gradle
-
Download the project or clone the repository
-
In a command prompt, navigate to the folder
springmvcand run the commandgradlew bootRun(on Linux./gradlew bootRun). If you are using Windows, you can alternatively double-click the fileRun-Sample.bat. -
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
If you are on Linux, you may have to add the execution permission to gradrew file by executing the command
chmod +x gradlew.
Using Maven
-
Download the project or clone the repository
-
In a command prompt, navigate to the folder
springmvcand run the commandmvn spring-boot:run. To run this command, it's necessary to have the Apache Maven installed. -
Once you see the message "Started Application in x.xxx seconds", open a web browser and go the URL http://localhost:60695
To open one of the samples on Eclipse, run gradlew eclipse on the sample's folder and then
then import the project from Eclipse.
To open one of the samples on IntelliJ IDEA, run gradlew idea on the sample's folder
and then use the "Open" funcionality inside IDEA (works better than "Import").
The samples use a client lib which encapsulates the API calls to REST PKI. This library supports Java 7 or greater. The lib should be referenced as a dependency, as can be seen in the file build.gradle of each sample:
repositories {
mavenCentral()
}
dependencies {
implementation 'com.lacunasoftware.restpki:restpki-client:1.15.7'
}
If you project uses Maven, please refer to the file pom.xml instead:
<dependencies>
...
<dependency>
<groupId>com.lacunasoftware.restpki</groupId>
<artifactId>restpki-client</artifactId>
<version>1.15.7</version>
</dependency>
...
</dependencies>
...
If your project uses another tool for dependency resolution (e.g. Ivy), please visit the package page on Maven.
The samples use a client lib which encapsulates the API calls to Rest PKI Core. This library supports Java 8 or greater. The lib should be referenced as a dependency, as can be seen in the file build.gradle of each sample:
repositories {
mavenCentral()
}
dependencies {
implementation 'com.lacunasoftware.restpki:restpkicore-client:1.1.1'
}
If you project uses Maven, please refer to the file pom.xml instead:
<dependencies>
...
<dependency>
<groupId>com.lacunasoftware.restpki</groupId>
<artifactId>restpkicore-client</artifactId>
<version>1.1.1</version>
</dependency>
...
</dependencies>
...
The samples use a client lib which encapsulates the API calls to Amplia. This library supports Java 7 or greater. The lib should be referenced as a dependency, as can be seen in the file build.gradle of each sample:
repositories {
mavenCentral()
}
dependencies {
implementation 'com.lacunasoftware.amplia:amplia-client:1.1.2'
}
If you project uses Maven, please refer to the file pom.xml instead:
<dependencies>
...
<dependency>
<groupId>com.lacunasoftware.amplia</groupId>
<artifactId>amplia-client</artifactId>
<version>1.1.2</version>
</dependency>
...
</dependencies>
...
If your project uses another tool for dependency resolution (e.g. Ivy), please visit the package page on Maven.
The samples use a helper library which encapsulates the communication with PKI Express. This library supports Java 7 or greater. The lib should be referenced as a dependency, as can be seen in the file build.gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'com.lacunasoftware.pkiexpress:pki-express:1.19.0'
}
If you project uses Maven, please refer to the file pom.xml instead:
<dependencies>
...
<dependency>
<groupId>com.lacunasoftware.pkiexpress</groupId>
<artifactId>pki-express</artifactId>
<version>1.19.0</version>
</dependency>
...
</dependencies>
...
If your project uses another tool for dependency resolution (e.g. Ivy), please visit the package page on Maven.
After installing PKI Express, is necessary to activate it. On Linux, execute the following command with root permissions:
$ sudo pkie activate LacunaPkiLicense.config
On Windows, run the PKI Express Configuration Manager (file pkiemgr.exe on the installation folder
ex.: C:\Program Files\Lacuna Software\PKI Express) and follow the instructions to activate PKI Express.