Skip to content

Repository files navigation

NATS

Java JWT Utilities Library

The library provides utilities for reading and creating JWTs used by the NATS server.

3.0.0 3.0.1

Build Main Badge Coverage Status Javadoc License Apache 2

API Dependencies

group artifact version
io.nats.nkeys core-jdk<17/21/25> 3.0.4
io.nats jnats-json-jdk<17/21/25> 3.0.5

JDK Version

This project uses Java 8 Language Level api, but builds jars compiled with and targeted for Java 8, 17, 21 and 25. It creates different artifacts for each. All have the same group id io.nats and the same version but have different artifact names.

Java Target Level Artifact Id Maven Central
17 jwt-utils-jdk17 Maven JDK 17
21 jwt-utils-jdk21 Maven JDK 21
25 jwt-utils-jdk25 Maven JDK 25

Dependency Management

The NATS client is available in the Maven central repository, and can be imported as a standard dependency in your build.gradle or pom.xml file, The examples shown use the Jdk 8 version. To use other versions, change the artifact id.

Gradle

dependencies {
    implementation 'io.nats:jwt-utils:3.0.0'
}

If you need the latest and greatest before Maven central updates, you can use:

repositories {
    mavenCentral()
    maven {
        url "https://repo1.maven.org/maven2/"
    }
}

If you need a snapshot version, you must add the url for the snapshots and change your dependency.

repositories {
    mavenCentral()
    maven {
        url "https://central.sonatype.com/repository/maven-snapshots"
    }
}

dependencies {
   implementation 'io.nats:jwt-utils:3.0.1-SNAPSHOT'
}

Maven

<dependency>
    <groupId>io.nats</groupId>
    <artifactId>jwt-utils</artifactId>
    <version>3.0.0</version>
</dependency>

If you need the absolute latest, before it propagates to maven central, you can use the repository:

<repositories>
    <repository>
        <id>sonatype releases</id>
        <url>https://repo1.maven.org/maven2/</url>
        <releases>
           <enabled>true</enabled>
        </releases>
    </repository>
</repositories>

If you need a snapshot version, you must enable snapshots and change your dependency.

<repositories>
    <repository>
        <id>sonatype snapshots</id>
        <url>https://central.sonatype.com/repository/maven-snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<dependency>
    <groupId>io.nats</groupId>
    <artifactId>jwt-utils</artifactId>
    <version>3.0.1-SNAPSHOT</version>
</dependency>

License

Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

About

JWT tokens signed using NKeys for Ed25519 for the NATS ecosystem [Java]

Resources

Code of conduct

Stars

3 stars

Watchers

11 watching

Forks

Releases

Packages

Used by

Contributors

Languages