dev.samstevens.totp.qr.QrDataFactory 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.code.HashingAlgorithm;
public class QrDataFactory {
private HashingAlgorithm defaultAlgorithm;
private int defaultDigits;
private int defaultTimePeriod;
public QrDataFactory(HashingAlgorithm defaultAlgorithm, int defaultDigits, int defaultTimePeriod) {
this.defaultAlgorithm = defaultAlgorithm;
this.defaultDigits = defaultDigits;
this.defaultTimePeriod = defaultTimePeriod;
}
public QrData.Builder newBuilder() {
return new QrData.Builder()
.algorithm(defaultAlgorithm)
.digits(defaultDigits)
.period(defaultTimePeriod);
}
}