Package org.wildfly.security.jose.jwk
Class JWKUtil
- java.lang.Object
-
- org.wildfly.security.jose.jwk.JWKUtil
-
public class JWKUtil extends Object
Utility methods for use with JSON Web Keys.- Since:
- 1.14.0
- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description static org.wildfly.common.codec.Base64Alphabet
BASE64_URL
The RFC 4648 base64url alphabet.
-
Constructor Summary
Constructors Constructor Description JWKUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
base64UrlDecode(String data)
static String
base64UrlEncode(byte[] data)
static String
generateThumbprint(String[] certChain, String algorithm)
Generate the thumbprint for the first certificate in the given certificate chain.(package private) static byte[]
generateThumbprintBytes(String[] certChain, String algorithm)
-
-
-
Field Detail
-
BASE64_URL
public static final org.wildfly.common.codec.Base64Alphabet BASE64_URL
The RFC 4648 base64url alphabet.
-
-
Method Detail
-
base64UrlEncode
public static String base64UrlEncode(byte[] data)
-
base64UrlDecode
public static byte[] base64UrlDecode(String data)
-
generateThumbprint
public static String generateThumbprint(String[] certChain, String algorithm) throws NoSuchAlgorithmException
Generate the thumbprint for the first certificate in the given certificate chain.- Parameters:
certChain
- the certificate chain in PEM formatalgorithm
- the algorithm to use- Returns:
- the generated thumbprint for the first certificate in the given certificate chain in base64url format
- Throws:
NoSuchAlgorithmException
- if the given algorithm cannot be used
-
generateThumbprintBytes
static byte[] generateThumbprintBytes(String[] certChain, String algorithm) throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
-