Java library for SPIFFE support
Go to file
Max Lambrecht c010b90c00 Add OS/JDK matrix to Github Actions config.
Update build badge link.

Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
2021-06-22 11:36:18 -03:00
.github/workflows Add OS/JDK matrix to Github Actions config. 2021-06-22 11:36:18 -03:00
gradle/wrapper Add Github Actions. 2021-06-19 15:55:27 -03:00
java-spiffe-core Update workload.proto with the lastest version from the SPIFFE repo. 2021-05-27 15:55:07 -03:00
java-spiffe-helper Add FetchX509Bundles method to Workload API client 2021-03-08 18:44:21 -03:00
java-spiffe-provider Remove separator argument from toSetOfSpiffeIds() examples 2021-01-12 20:31:26 -08:00
.gitignore First commit 2018-05-28 12:39:13 -03:00
CODEOWNERS Add maintainer to CODEOWNERS file 2020-11-09 17:42:15 -03:00
LICENSE Adding LICENSE 2018-08-22 10:53:38 -03:00
README.md Fix typo in README.md 2020-11-24 09:41:12 -08:00
build.gradle Add Github Actions. 2021-06-19 15:55:27 -03:00
gradlew First commit 2018-05-28 12:39:13 -03:00
gradlew.bat First commit 2018-05-28 12:39:13 -03:00
lombok.config Adding utility methods for generating x509 certificates for testing purposes. 2020-05-22 09:31:32 -03:00
settings.gradle Use google osdetector plugin instead of internal gradle class. 2020-11-24 10:57:37 -03:00

README.md

Java SPIFFE Library

Coverage Status

Overview

The JAVA-SPIFFE library provides functionality to interact with the Workload API to fetch X.509 and JWT SVIDs and Bundles, and a Java Security Provider implementation to be plugged into the Java Security architecture. This is essentially an X.509-SVID based KeyStore and TrustStore implementation that handles the certificates in memory and receives the updates asynchronously from the Workload API. The KeyStore handles the Certificate chain and Private Key to prove identity in a TLS connection, and the TrustStore handles the trusted bundles (supporting federated bundles) and performs peer's certificate and SPIFFE ID verification.

This library contains three modules:

  • java-spiffe-core: Core functionality to interact with the Workload API, and to process and validate X.509 and JWT SVIDs and bundles.

  • java-spiffe-provider: Java Provider implementation.

  • java-spiffe-helper: Helper to store X.509 SVIDs and Bundles in Java Keystores in disk.

Supports Java 8+

Download

The JARs can be downloaded from Maven Central.

The dependencies can be added to pom.xml

To import the java-spiffe-provider component:

<dependency>
  <groupId>io.spiffe</groupId>
  <artifactId>java-spiffe-provider</artifactId>
  <version>0.6.3</version>
</dependency>

The java-spiffe-provider component imports the java-spiffe-core component.

To just import the java-spiffe-core component:

<dependency>
  <groupId>io.spiffe</groupId>
  <artifactId>java-spiffe-core</artifactId>
  <version>0.6.3</version>
</dependency>

Using Gradle:

Import java-spiffe-provider:

implementation group: 'io.spiffe', name: 'java-spiffe-provider', version: '0.6.3'

Import java-spiffe-core:

implementation group: 'io.spiffe', name: 'java-spiffe-core', version: '0.6.3'

MacOS Support

Add to your pom.xml:

<dependency>
  <groupId>io.spiffe</groupId>
  <artifactId>grpc-netty-macos</artifactId>
  <version>0.6.3</version>
  <scope>runtime</scope>
</dependency>

Using Gradle:

runtimeOnly group: 'io.spiffe', name: 'grpc-netty-macos', version: '0.6.3'

Note: java-spiffe-helper artifact

As the java-spiffe-helper artifact is meant to be used as a standalone JAR and not as a Maven dependency, it is not published to Maven Central, but to Github releases, for both Linux and MacOS versions.

Build the JARs

On Linux or MacOS, run:

 $ ./gradlew assemble
 BUILD SUCCESSFUL 

All jar files are placed in build/libs folder.

Jars that include all dependencies

For the module java-spiffe-provider, a fat jar is generated with the classifier -all-[os-classifier].

For the module java-spiffe-helper, a fat jar is generated with the classifier [os-classifier].

Based on the OS where the build is run, the [os-classifier] will be:

  • -linux-x86_64 for Linux
  • -osx-x86_64 for MacOS