Class JWKUtil


  • public class JWKUtil
    extends Object
    Utility methods for use with JSON Web Keys.
    Since:
    1.14.0
    Author:
    Farah Juma
    • Field Detail

      • BASE64_URL

        public static final org.wildfly.common.codec.Base64Alphabet BASE64_URL
        The RFC 4648 base64url alphabet.
    • Constructor Detail

      • JWKUtil

        public JWKUtil()
    • 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 format
        algorithm - 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