Package com.networknt.security
Class JwtIssuer
- java.lang.Object
-
- com.networknt.security.JwtIssuer
-
public class JwtIssuer extends Object
JWT token issuer helper utility that use by light-ouath2 token and code services to generate JWT tokens.- Author:
- Steve Hu
-
-
Field Summary
Fields Modifier and Type Field Description static StringJWT_CONFIGstatic StringJWT_PRIVATE_KEY_PASSWORDstatic StringSECRET_CONFIG
-
Constructor Summary
Constructors Constructor Description JwtIssuer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.jose4j.jwt.JwtClaimsgetDefaultJwtClaims()Construct a default JwtClaimsstatic StringgetJwt(org.jose4j.jwt.JwtClaims claims)A static method that generate JWT token from JWT claims objectstatic org.jose4j.jwt.JwtClaimsgetJwtClaimsWithExpiresIn(int expiresIn)Construct a default JwtClaims
-
-
-
Field Detail
-
JWT_CONFIG
public static final String JWT_CONFIG
- See Also:
- Constant Field Values
-
SECRET_CONFIG
public static final String SECRET_CONFIG
- See Also:
- Constant Field Values
-
JWT_PRIVATE_KEY_PASSWORD
public static final String JWT_PRIVATE_KEY_PASSWORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getJwt
public static String getJwt(org.jose4j.jwt.JwtClaims claims) throws org.jose4j.lang.JoseException
A static method that generate JWT token from JWT claims object- Parameters:
claims- JwtClaims object- Returns:
- A string represents jwt token
- Throws:
org.jose4j.lang.JoseException- JoseException
-
getDefaultJwtClaims
public static org.jose4j.jwt.JwtClaims getDefaultJwtClaims()
Construct a default JwtClaims- Returns:
- JwtClaims
-
getJwtClaimsWithExpiresIn
public static org.jose4j.jwt.JwtClaims getJwtClaimsWithExpiresIn(int expiresIn)
Construct a default JwtClaims- Parameters:
expiresIn- expires in- Returns:
- JwtClaims
-
-