Package org.keycloak.utils
Class QRCodeUtils
java.lang.Object
org.keycloak.utils.QRCodeUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]encodeAsQRBytes(String contentToEncode, int width, int height) Encode specified String as a QR code in PNG formatstatic StringencodeAsQRString(String contentToEncode, int width, int height) Encode specified String as a QR code in PNG format
-
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 encodewidth- width of the resulting QR codeheight- height of the resulting QR code- Returns:
- bytes with encoded QR code
- Throws:
com.google.zxing.WriterExceptionIOException
-
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 encodewidth- width of the resulting QR codeheight- height of the resulting QR code- Returns:
- Encoded QR code returned in the Base64 encoded string
- Throws:
com.google.zxing.WriterExceptionIOException
-