Package io.jans.as.model.util
Class JwtUtil
- java.lang.Object
-
- io.jans.as.model.util.JwtUtil
-
public class JwtUtil extends java.lang.ObjectUtility class (can't be instantiated), that provides suite of additional functions, which can be used, during JWT/JWE processing.- Version:
- December 5, 2021
- Author:
- Javier Rojas Blum, Yuriy Movchan, Sergey Manoylo
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbytesToHex(byte[] bytes)static org.json.JSONObjectfromJson(java.lang.String json)static org.json.JSONObjectgetJsonKey(java.lang.String jwksUri, java.lang.String jwks, java.lang.String keyId)static org.json.JSONObjectgetJSONWebKeys(java.lang.String jwksUri)static org.json.JSONObjectgetJSONWebKeys(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 PublicKeygetPublicKey(java.lang.String jwksUri, java.lang.String jwks, SignatureAlgorithm signatureAlgorithm, java.lang.String keyId)static voidprintAlgorithms(java.lang.String algorithmType)static voidprintAlgorithmsAndProviders()static voidtransferIntoJwtClaims(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.NoSuchProviderExceptionjava.security.NoSuchAlgorithmException
-
getMessageDigestSHA384
public static byte[] getMessageDigestSHA384(java.lang.String data) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException- Throws:
java.security.NoSuchProviderExceptionjava.security.NoSuchAlgorithmException
-
getMessageDigestSHA512
public static byte[] getMessageDigestSHA512(java.lang.String data) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException- Throws:
java.security.NoSuchProviderExceptionjava.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.NoSuchProviderExceptionjava.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)
-
-