e-CryptIt Engine Xojo Plugin

Einhugur_2FA_TOTP.GenerateQRCodeContent Method

Generates content for QRCode from given secret key. This variation will generate non standard customise setup.

shared GenerateQRCodeContent(
   secretKey as String,
   label as String,
   algorithm as Einhugur_2FA_TOTP.Algorithms,
   digits as Einhugur_2FA_TOTP.Digits,
   seconds as UInt16) as String

Parameters

secretKey
The secret key.

Secret keys are represented in various of ways and the plugin will preprocess them correctly to take all representations.

For example then all of the following keys are equal:
N7P7TWR3Q5WUA2XG
N7P7 TWR3 Q5WU A2XG
n7P7 tWR3 q5WU a2XG
label
Label which identifies the key for the authenticator apps.

At least for Microsoft authenticator app then its good to format this string like. “Facebook:bjorn”

Then in the authenticator apps you get Facebook listed as main and bjorn as line bellow indicating account name.
algorithm
The algorithm to use. Standard implementation uses HMAC_SHA1.
digits
Digits to use. Standard implementation uses six.
seconds
Seconds for the time window. Standard implementation is 30 seconds.

Returns

String
Content to put in QRCode.

Remarks

You can use the Einhugur BarcodePlugin to generate the actual QR code which contains the content returned by this function.


This function can throw InvalidArgumentException.

Some authentication apps only support the standard implementation while more advanced apps support customised setup.

See Also

Einhugur_2FA_TOTP Class