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 Details

    • BASE64_URL

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

    • JWKUtil

      public JWKUtil()
  • Method Details

    • 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