Package io.jans.as.model.util
Class JwtUtil
- java.lang.Object
-
- io.jans.as.model.util.JwtUtil
-
public class JwtUtil extends java.lang.Object
- Version:
- December 8, 2018
- Author:
- Javier Rojas Blum, Yuriy Movchan
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
bytesToHex(byte[] bytes)
static org.json.JSONObject
fromJson(java.lang.String json)
static org.json.JSONObject
getJsonKey(java.lang.String jwksUri, java.lang.String jwks, java.lang.String keyId)
static org.json.JSONObject
getJSONWebKeys(java.lang.String jwksUri)
static org.json.JSONObject
getJSONWebKeys(java.lang.String jwksUri, org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine)
static byte[]
getMessageDigest(java.lang.String data, java.lang.String algorithm)
static byte[]
getMessageDigestSHA256(java.lang.String data)
static byte[]
getMessageDigestSHA384(java.lang.String data)
static byte[]
getMessageDigestSHA512(java.lang.String data)
static PublicKey
getPublicKey(java.lang.String jwksUri, java.lang.String jwks, SignatureAlgorithm signatureAlgorithm, java.lang.String keyId)
static void
printAlgorithms(java.lang.String algorithmType)
static void
printAlgorithmsAndProviders()
static void
transferIntoJwtClaims(org.json.JSONObject jsonObject, Jwt jwt)
-
-
-
Method Detail
-
printAlgorithmsAndProviders
public static void printAlgorithmsAndProviders()
-
printAlgorithms
public static void printAlgorithms(java.lang.String algorithmType)
-
bytesToHex
public static java.lang.String bytesToHex(byte[] bytes)
-
getMessageDigestSHA256
public static byte[] getMessageDigestSHA256(java.lang.String data) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
-
getMessageDigestSHA384
public static byte[] getMessageDigestSHA384(java.lang.String data) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
-
getMessageDigestSHA512
public static byte[] getMessageDigestSHA512(java.lang.String data) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
-
getMessageDigest
public static byte[] getMessageDigest(java.lang.String data, java.lang.String algorithm) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
-
getPublicKey
public static PublicKey getPublicKey(java.lang.String jwksUri, java.lang.String jwks, SignatureAlgorithm signatureAlgorithm, java.lang.String keyId)
-
getJsonKey
public static org.json.JSONObject getJsonKey(java.lang.String jwksUri, java.lang.String jwks, java.lang.String keyId)
-
getJSONWebKeys
public static org.json.JSONObject getJSONWebKeys(java.lang.String jwksUri)
-
getJSONWebKeys
public static org.json.JSONObject getJSONWebKeys(java.lang.String jwksUri, org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine)
-
fromJson
public static org.json.JSONObject fromJson(java.lang.String json) throws java.io.IOException
- Throws:
java.io.IOException
-
transferIntoJwtClaims
public static void transferIntoJwtClaims(org.json.JSONObject jsonObject, Jwt jwt)
-
-