Class QRCodeUtils

java.lang.Object
org.keycloak.utils.QRCodeUtils

public class QRCodeUtils extends Object
  • Constructor Details

    • QRCodeUtils

      public QRCodeUtils()
  • Method Details

    • encodeAsQRBytes

      public static byte[] encodeAsQRBytes(String contentToEncode, int width, int height) throws com.google.zxing.WriterException, IOException
      Encode specified String as a QR code in PNG format
      Parameters:
      contentToEncode - content to encode
      width - width of the resulting QR code
      height - height of the resulting QR code
      Returns:
      bytes with encoded QR code
      Throws:
      com.google.zxing.WriterException
      IOException
    • encodeAsQRString

      public static String encodeAsQRString(String contentToEncode, int width, int height) throws com.google.zxing.WriterException, IOException
      Encode specified String as a QR code in PNG format
      Parameters:
      contentToEncode - content to encode
      width - width of the resulting QR code
      height - height of the resulting QR code
      Returns:
      Encoded QR code returned in the Base64 encoded string
      Throws:
      com.google.zxing.WriterException
      IOException