All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bertomanfreda.java-jwt.1.2.0-RELEASE.source-code.Main Maven / Gradle / Ivy

import com.github.robertomanfreda.java.jwt.core.JavaJWT;
import com.nimbusds.jose.Payload;

import java.nio.file.Path;
import java.util.Map;

public class Main {
    public static void main(String[] args) throws Exception {
        JavaJWT javaJwt = new JavaJWT(Path.of("/home/roberto/keystore/keystore.zip"));

        // generate
        System.out.println();
        String generated = javaJwt.generate(
                "test", "test", Map.of("test", 1), 100
        );
        System.out.println(generated);

        // verify
        System.out.println();
        Payload verified = javaJwt.verifyAndDecrypt(generated);
        System.out.println(verified.toString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy