Interface ITotpSecretGenerator
- Namespace
- GastroSky.Services.Totp.TotpSecretGenerator
- Assembly
- GastroSky.dll
TOTP Secret string generator service (for 2FA; Google Auth, etc...).
public interface ITotpSecretGenerator
Methods
GenerateSecret(int)
Generates a new TOTP secret, base-32 encoded (ready to be scanned by Authy or Google Authenticator).
string GenerateSecret(int size = 20)
Parameters
sizeintThe secret size (default value is 20).
Returns
- string
Fresh, random TOTP secret, already base-32 encoded (ready to be scanned by Authy or Google Authenticator).
Exceptions
- ArgumentException
Thrown when the
sizeargument is less than the minimum required size of10.