1818/**
1919 * Stores the shared secret key and other parameters to generate time-based OTPs.
2020 * Implements methods to retrieve the shared secret key, generate a QRCode URL.
21+ * @public
2122 */
22-
2323export class TotpSecret {
2424 constructor (
2525 readonly secretKey : string ,
2626 readonly hashingAlgorithm : string ,
2727 readonly codeLength : number ,
2828 readonly codeIntervalSeconds : number
2929 ) { }
30- /**
31- * Returns the shared secret key/seed used to generate time-based one-time passwords.
32- *
33- * @returns Shared secret key/seed used for enrolling in TOTP MFA and generating otps.
34- */
35- sharedSecretKey ( ) : string {
36- return this . secretKey ;
37- }
38-
39- /**
40- * Returns the hashing algorithm used to generate time-based one-time passwords.
41- *
42- * @returns Hashing algorithm used.
43- */
44- getHashingAlgorithm ( ) : string {
45- return this . hashingAlgorithm ;
46- }
47-
48- /**
49- * Returns the length of the OTP codes to be generated.
50- *
51- * @returns Length of the one-time passwords to be generated.
52- */
53- getCodeLength ( ) : number {
54- return this . codeLength ;
55- }
56-
57- /**
58- * Returns the interval(in seconds) when the OTP codes should change.
59- *
60- * @returns The interval (in seconds) when the OTP codes should change.
61- */
62- getCodeIntervalSeconds ( ) : number {
63- return this . codeIntervalSeconds ;
64- }
65-
6630 /**
6731 * Returns a QRCode URL as described in
6832 * https://github.com/google/google-authenticator/wiki/Key-Uri-Format
@@ -73,8 +37,7 @@ export class TotpSecret {
7337 * @param issuer issuer of the TOTP(likely the app name).
7438 * @returns A QRCode URL string.
7539 */
76-
77- generateQrCodeUrl ( _accountName ?: string , issuer ?: string ) : string {
78- return null as any ;
40+ generateQrCodeUrl ( _accountName ?: string , _issuer ?: string ) : string {
41+ throw new Error ( 'Unimplemented' ) ;
7942 }
8043}
0 commit comments