OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
UserCredentials.h
Go to the documentation of this file.
1/*
2 * credentials.h
3 *
4 */
5
6#pragma once
7#pragma warning(disable : 4251)
8
9// OpenTwin header
11
12// std header
13#include <string>
14
15namespace ot {
17 {
18 public:
20 virtual ~UserCredentials() {};
21
22 void setUserName(std::string name) { userName = encryptString(name); }
23 std::string getUserName(void) { return decryptString(userName); }
24
25 void setPassword(std::string pwd) { userPassword = encryptString(pwd); }
26 void setEncryptedPassword(std::string pwd) { userPassword = pwd; }
27 std::string getEncryptedPassword(void) { return userPassword; }
28 std::string getPassword(void) { return decryptString(userPassword); }
29
30 static std::string encryptString(std::string data);
31 static std::string decryptString(std::string data);
32
33 private:
34 std::string userName;
35 std::string userPassword;
36 };
37}
#define OT_SERVICEFOUNDATION_API_EXPORT
Definition FoundationAPIExport.h:7
Definition UserCredentials.h:17
void setPassword(std::string pwd)
Definition UserCredentials.h:25
std::string getUserName(void)
Definition UserCredentials.h:23
void setUserName(std::string name)
Definition UserCredentials.h:22
void setEncryptedPassword(std::string pwd)
Definition UserCredentials.h:26
UserCredentials()
Definition UserCredentials.h:19
std::string getPassword(void)
Definition UserCredentials.h:28
std::string getEncryptedPassword(void)
Definition UserCredentials.h:27
virtual ~UserCredentials()
Definition UserCredentials.h:20
Definition Connector.h:8
OT_SERVICEFOUNDATION_API_EXPORT std::string decryptString(const std::string &_str)
Definition Encryption.cpp:47
OT_SERVICEFOUNDATION_API_EXPORT std::string encryptString(const std::string &_str)
Definition Encryption.cpp:15