dev.samstevens.totp.qr.QrGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of totp Show documentation
Show all versions of totp Show documentation
A library to help implement time-based one time passwords to enable MFA.
package dev.samstevens.totp.qr;
import dev.samstevens.totp.exceptions.QrGenerationException;
public interface QrGenerator {
/**
* @return The mime type of the image that the generator generates, e.g. image/png
*/
String getImageMimeType();
/**
* @param data The QrData object to encode in the generated image.
* @return The raw image data as a byte array.
* @throws QrGenerationException thrown if image generation fails for any reason.
*/
byte[] generate(QrData data) throws QrGenerationException;
}