Package io.jans.as.model.util
Class JwtUtil
java.lang.Object
io.jans.as.model.util.JwtUtil
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
Modifier and TypeMethodDescriptionstatic StringbytesToHex(byte[] bytes) static org.json.JSONObjectstatic 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 voidstatic voidtransferIntoJwtClaims(org.json.JSONObject jsonObject, Jwt jwt)
-
Method Details
-
printAlgorithmsAndProviders
public static void printAlgorithmsAndProviders() -
printAlgorithms
-
bytesToHex
-
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) -
getJsonKey
-
getJSONWebKeys
-
getJSONWebKeys
public static org.json.JSONObject getJSONWebKeys(String jwksUri, org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine) -
fromJson
- Throws:
IOException
-
transferIntoJwtClaims
-