### Build with Docker for development Source: https://nbaars.github.io/paseto4j Commands to build the project locally using Docker, avoiding the need to install Libsodium for Version 2. The first command builds the Docker image; the second runs the Maven verify command inside the container. ```bash docker build -t paseto4j . docker run -v "${HOME}"/.m2:/root/.m2 -v "${PWD}":/workspace paseto4j ./mvnw verify ``` -------------------------------- ### Using V{1,2,3,4}.public - sign and parse Source: https://nbaars.github.io/paseto4j Shows how to sign and parse a token using the public (asymmetric) API. The footer is optional and defaults to "". Version 3 supports an optional implicit assertion that defaults to "". ```java private static final String TOKEN = "{\"data\":\"this is a signed message\",\"expires\":\"2019-01-01T00:00:00+00:00\"}"; private static final String FOOTER = "Paragon Initiative Enterprises"; var signedToken = Paseto.sign(new PrivateKey(privateKey, V1), TOKEN, FOOTER); Paseto.parse(new PublicKey(publicKey, V1), signedToken, FOOTER);x ``` -------------------------------- ### Using V{1,2,3,4}.local - encrypt and decrypt Source: https://nbaars.github.io/paseto4j Shows how to encrypt and decrypt a token using the local (symmetric) API. The footer is optional and defaults to "". Version 3 supports an optional implicit assertion that defaults to "". ```java private static final String TOKEN = "{\"data\":\"this is a signed message\",\"expires\":\"2019-01-01T00:00:00+00:00\"}"; private static final String FOOTER = "Paragon Initiative Enterprises"; byte[] secretKey = ... var encryptedToken = Paseto.encrypt(new SecretKey(secretKey, V1), TOKEN, FOOTER); Paseto.decrypt(new SecretKey(secretKey, V1), encryptedToken, FOOTER); ``` -------------------------------- ### Add Paseto4j Maven dependency Source: https://nbaars.github.io/paseto4j Add the Paseto4j dependency to a Maven project. The artifact ID uses a placeholder for the version (1, 2, 3, or 4) and the version is specified by the property ${paseto4j.version}. ```xml io.github.nbaars paseto4j-version{1,2,3,4} ${paseto4j.version} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.