Package io.jans.as.model.util
Class JwtUtil
- java.lang.Object
-
- io.jans.as.model.util.JwtUtil
-
public class JwtUtil extends Object
Utility 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 StringbytesToHex(byte[] bytes)static org.json.JSONObjectfromJson(String json)static org.json.JSONObjectgetJsonKey(String jwksUri, String jwks, String keyId)static org.json.JSONObjectgetJSONWebKeys(String jwksUri)static org.json.JSONObjectgetJSONWebKeys(String jwksUri, org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine)static byte[]getMessageDigest(String data, String algorithm)static byte[]getMessageDigestSHA256(String data)static byte[]getMessageDigestSHA384(String data)static byte[]getMessageDigestSHA512(String data)static PublicKeygetPublicKey(String jwksUri, String jwks, SignatureAlgorithm signatureAlgorithm, String keyId)static voidprintAlgorithms(String algorithmType)static voidprintAlgorithmsAndProviders()static voidtransferIntoJwtClaims(org.json.JSONObject jsonObject, Jwt jwt)
-
-
-
Method Detail
-
printAlgorithmsAndProviders
public static void printAlgorithmsAndProviders()
-
printAlgorithms
public static void printAlgorithms(String algorithmType)
-
bytesToHex
public static String bytesToHex(byte[] bytes)
-
getMessageDigestSHA256
public static byte[] getMessageDigestSHA256(String data) throws NoSuchProviderException, NoSuchAlgorithmException
-
getMessageDigestSHA384
public static byte[] getMessageDigestSHA384(String data) throws NoSuchProviderException, NoSuchAlgorithmException
-
getMessageDigestSHA512
public static byte[] getMessageDigestSHA512(String data) throws NoSuchProviderException, NoSuchAlgorithmException
-
getMessageDigest
public static byte[] getMessageDigest(String data, String algorithm) throws NoSuchProviderException, NoSuchAlgorithmException
-
getPublicKey
public static PublicKey getPublicKey(String jwksUri, String jwks, SignatureAlgorithm signatureAlgorithm, String keyId)
-
getJSONWebKeys
public static org.json.JSONObject getJSONWebKeys(String jwksUri)
-
getJSONWebKeys
public static org.json.JSONObject getJSONWebKeys(String jwksUri, org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine)
-
fromJson
public static org.json.JSONObject fromJson(String json) throws IOException
- Throws:
IOException
-
transferIntoJwtClaims
public static void transferIntoJwtClaims(org.json.JSONObject jsonObject, Jwt jwt)
-
-