Class JWKUtil
java.lang.Object
org.wildfly.security.jose.jwk.JWKUtil
Utility methods for use with JSON Web Keys.
- Since:
- 1.14.0
- Author:
- Farah Juma
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.wildfly.common.codec.Base64AlphabetThe RFC 4648 base64url alphabet. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]base64UrlDecode(String data) static Stringbase64UrlEncode(byte[] data) static StringgenerateThumbprint(String[] certChain, String algorithm) Generate the thumbprint for the first certificate in the given certificate chain.
-
Field Details
-
BASE64_URL
public static final org.wildfly.common.codec.Base64Alphabet BASE64_URLThe RFC 4648 base64url alphabet.
-
-
Constructor Details
-
JWKUtil
public JWKUtil()
-
-
Method Details
-
base64UrlEncode
-
base64UrlDecode
-
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
-