18
18
/**
19
19
* Stores the shared secret key and other parameters to generate time-based OTPs.
20
20
* Implements methods to retrieve the shared secret key, generate a QRCode URL.
21
+ * @public
21
22
*/
22
-
23
23
export class TotpSecret {
24
24
constructor (
25
25
readonly secretKey : string ,
26
26
readonly hashingAlgorithm : string ,
27
27
readonly codeLength : number ,
28
28
readonly codeIntervalSeconds : number
29
29
) { }
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
-
30
+
66
31
/**
67
32
* Returns a QRCode URL as described in
68
33
* https://github.com/google/google-authenticator/wiki/Key-Uri-Format
@@ -74,7 +39,7 @@ export class TotpSecret {
74
39
* @returns A QRCode URL string.
75
40
*/
76
41
77
- generateQrCodeUrl ( _accountName ?: string , issuer ?: string ) : string {
78
- return null as any ;
42
+ generateQrCodeUrl ( _accountName ?: string , _issuer ?: string ) : string {
43
+ throw new Error ( 'Unimplemented' ) ;
79
44
}
80
45
}
0 commit comments