| 1 | #ifndef OTPPASS_HH |
| 2 | #define OTPPASS_HH |
| 3 | |
| 4 | #include <cstdint> |
| 5 | #include <string> |
| 6 | #include <vector> |
| 7 | |
| 8 | class Otppass { |
| 9 | public: |
| 10 | std::string exec(std::string &file); |
| 11 | |
| 12 | private: |
| 13 | std::vector<unsigned char> extract_secret(const std::string &otpauth_url); |
| 14 | #if defined(__HAIKU__) || defined(__linux) |
| 15 | uint64_t htobe64(uint64_t counter); |
| 16 | #endif |
| 17 | uint32_t generate_totp(const std::vector<unsigned char> &secret, |
| 18 | uint64_t counter); |
| 19 | }; |
| 20 | |
| 21 | #endif |