-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathYubiOTP.h
39 lines (36 loc) · 942 Bytes
/
YubiOTP.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
YubiOTP.h - Library for validating Yubi One-Time-Passwords (OTP)
Created by Cyber Ninjas Inc, March 4, 2016
Released under GPL v3
*/
#ifndef YubiOTP_h
#define YubiOTP_h
#include "Arduino.h"
#include "Client.h"
class YubiOTP {
public:
YubiOTP(Client& client);
void setOTP(String otp);
void setId(int id);
void setb64HmacKey(String key);
void setPort(int port);
void setSigned(boolean shouldSign);
void setServers(String servers[], int serverCount);
boolean validateOTP();
private:
String _servers[5];
String _otp;
int _port;
int _id;
String _b64hmackey;
boolean _shouldSign;
Client& _client;
int _maxTimeMilliSecs;
String getOTPResult();
String getNonce();
String getRequest(String server, int port, String url);
String getHMACSha1(String input);
String base64EncodeString(String input);
String base64DecodeString(String input);
};
#endif