@Test public void generateToken() { SingleJWT jwt = new SingleJWT("secret", 1000); String token = jwt.generateToken("test", 1, "test", 1000); assertNotNull(token); log.info(token); }
public String generateToken(String tokenType, long identity, String scope, long expire) { Date expireDate = DateUtil.getDurationDate(expire); return builder .withClaim("type", tokenType) .withClaim("identity", identity) .withClaim("scope", scope) .withExpiresAt(expireDate) .sign(algorithm); }
SingleJWT { public String generateToken(String tokenType, long identity, String scope, long expire) { Date expireDate = DateUtil.getDurationDate(expire); return builder .withClaim("type", tokenType) .withClaim("identity", identity) .withClaim("scope", scope) .withExpiresAt(expireDate) .sign(algorithm); } }
SingleJWT { public String generateToken(String tokenType, long identity, String scope, long expire) { Date expireDate = DateUtil.getDurationDate(expire); return builder .withClaim("type", tokenType) .withClaim("identity", identity) .withClaim("scope", scope) .withExpiresAt(expireDate) .sign(algorithm); } SingleJWT(Algorithm algorithm, long expire);  SingleJWT(String secret, long expire); }
SingleJWT { public String generateToken(String tokenType, long identity, String scope, long expire) { Date expireDate = DateUtil.getDurationDate(expire); return builder .withClaim("type", tokenType) .withClaim("identity", identity) .withClaim("scope", scope) .withExpiresAt(expireDate) .sign(algorithm); } SingleJWT(Algorithm algorithm, long expire);  SingleJWT(String secret, long expire); String generateToken(String tokenType, long identity, String scope, long expire); Map<String, Claim> decodeToken(String token); JWTVerifier getVerifier(); JWTCreator.Builder getBuilder(); Algorithm getAlgorithm(); Long getExpire(); }
SingleJWT { public String generateToken(String tokenType, long identity, String scope, long expire) { Date expireDate = DateUtil.getDurationDate(expire); return builder .withClaim("type", tokenType) .withClaim("identity", identity) .withClaim("scope", scope) .withExpiresAt(expireDate) .sign(algorithm); } SingleJWT(Algorithm algorithm, long expire);  SingleJWT(String secret, long expire); String generateToken(String tokenType, long identity, String scope, long expire); Map<String, Claim> decodeToken(String token); JWTVerifier getVerifier(); JWTCreator.Builder getBuilder(); Algorithm getAlgorithm(); Long getExpire();  }