Package com.vasco.image.generator
Class ImageGeneratorSDK
- java.lang.Object
-
- com.vasco.image.generator.ImageGeneratorSDK
-
public final class ImageGeneratorSDK extends java.lang.Object
The Image Generator SDK main class. It can generate a QR code or a CrontoSign image.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
VERSION
Version of the Image Generator SDK
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BWQRCodeResponse
generateBWQRCode(int imageSize, java.lang.String inputValue, int errorCorrectionLevel)
Generates a black and white QR code imagestatic java.awt.image.BufferedImage
generateCrontoSign(int squareSize, java.lang.String inputValue)
Generates a CRONTO image for the corresponding input values.static java.awt.image.BufferedImage
generateCrontoSign(int squareSize, java.lang.String inputValue, boolean onPaper)
Generates a CRONTO image for the corresponding input values.static java.awt.image.BufferedImage
generateDynamicCrontoImage(int squareSize, java.lang.String inputValue, boolean onPaper)
Generates a CRONTO image for the corresponding input values.
-
-
-
Field Detail
-
VERSION
public static final java.lang.String VERSION
Version of the Image Generator SDK- See Also:
- Constant Field Values
-
-
Method Detail
-
generateCrontoSign
public static java.awt.image.BufferedImage generateCrontoSign(int squareSize, java.lang.String inputValue) throws ImageGeneratorSDKException
Generates a CRONTO image for the corresponding input values. A scrambling is applied on the input before generating the image. The output image is to be printed on paper.- Parameters:
squareSize
- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE
, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZE
inputValue
- The hexadecimal string to encode- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException
- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTY
if the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONG
if the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXA
if the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVEN
if the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUE
if the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERROR
if an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERROR
if an internal error is raised
-
generateCrontoSign
public static java.awt.image.BufferedImage generateCrontoSign(int squareSize, java.lang.String inputValue, boolean onPaper) throws ImageGeneratorSDKException
Generates a CRONTO image for the corresponding input values. A scrambling is applied on the input before generating the image.- Parameters:
squareSize
- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE
, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZE
inputValue
- The hexadecimal string to encode. The max size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_INPUT_VALUE_LENGTH
onPaper
- true if and only if the image is to be printed on paper- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException
- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTY
if the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONG
if the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXA
if the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVEN
if the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUE
if the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERROR
if an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERROR
if an internal error is raised
-
generateDynamicCrontoImage
public static java.awt.image.BufferedImage generateDynamicCrontoImage(int squareSize, java.lang.String inputValue, boolean onPaper) throws ImageGeneratorSDKException
Generates a CRONTO image for the corresponding input values. The size of the image is dynamic and depends on the inputValue length. CAUTION: The CRONTO images generated with this method cannot be scanned by VASCO hardware authenticators (e.g. DP760, DP780).- Parameters:
squareSize
- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE
, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZE
inputValue
- The hexadecimal string to encode. The max size isImageGeneratorSDKConstants.DYNAMIC_CRONTO_IMAGE_MAX_INPUT_VALUE_LENGTH
onPaper
- true if and only if the image is to be printed on paper- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException
- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTY
if the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONG
if the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXA
if the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVEN
if the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUE
if the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERROR
if an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERROR
if an internal error is raised
-
generateBWQRCode
public static BWQRCodeResponse generateBWQRCode(int imageSize, java.lang.String inputValue, int errorCorrectionLevel) throws ImageGeneratorSDKException
Generates a black and white QR code image- Parameters:
imageSize
- The side length of the generated image. The minimum image size isImageGeneratorSDKConstants.QRCODE_MIN_IMAGE_SIZE
, and the maximum image size isImageGeneratorSDKConstants.QRCODE_MAX_IMAGE_SIZE
inputValue
- The alphanumeric string to encode. Supported values are : 0-9, A-Z (upper-case only), space, $, %, *, +, -, ., /, :errorCorrectionLevel
- The error correction level (which isImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_LOW
,ImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_MIDDLE
,ImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_QUALITY
orImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_HIGH
)- Returns:
- A
BWQRCodeResponse
object containing the QR code image and the associated boolean matrix - Throws:
ImageGeneratorSDKException
- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTY
if the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONG
if the input value is too longImageGeneratorSDKErrorCodes.QRCODE_IMAGE_SIZE_INVALID_VALUE
if the image size is invalidImageGeneratorSDKErrorCodes.QRCODE_ERROR_CORRECTION_LEVEL_INVALID_VALUE
if the error correction level is invalidImageGeneratorSDKErrorCodes.INTERNAL_ERROR
if an internal error is raised
-
-