Virtru SDK for C++  2.8.0
Virtru C++ SDK library - Create, Read, and Manage TDF3 Files
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
virtru_credentials.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2020 Virtru Corporation
3 *
4 * SPDX - License - Identifier: MIT
5 *
6 */
7 //
8 // Virtru TDF3 SDK
9 //
10 // Created by Pat Mancuso on 2020/10/12
11 //
12 
13 #ifndef VIRTRU_TDF3_SDK_VIRTRU_CREDENTIALS_H
14 #define VIRTRU_TDF3_SDK_VIRTRU_CREDENTIALS_H
15 
16 #include <string>
17 #include <map>
18 #include <vector>
19 #include <memory>
20 
21 namespace virtru {
22 
23  enum class CredentialsType {
24  None
25  ,AppId
26  ,HMAC
27  ,VJWT
28  ,OIDC
29  };
30 
31  class Credentials {
32  public:
36 
37  //JAVACPPSKIPBEGIN
40 #ifndef SWIG
41  virtual std::unique_ptr<Credentials> clone() const;
42 #endif
43  //JAVACPPSKIPEND
44 
46  virtual ~Credentials();
47 
50  CredentialsType getType() const;
51 
54  std::string getTypeStr() const;
55 
58  virtual std::string str() const;
59 
60  //JAVACPPSKIPBEGIN
68  virtual std::map<std::string, std::string> generateAuthHeaders(const std::string& url, const std::string& method, const std::string& body, const std::map<std::string, std::string> &headers, const std::string& date);
69  //JAVACPPSKIPEND
70 
72  virtual std::string getUserId() const;
73 
74  protected:
76  std::map<std::string, std::string> parseUrlTODO(const std::string& url) const;
77  };
78 }
79 
80 #endif //VIRTRU_TDF3_SDK_VIRTRU_CREDENTIALS_H
virtual std::string str() const
CredentialsType
Definition: virtru_credentials.h:23
virtual std::unique_ptr< Credentials > clone() const
Credentials(CredentialsType type=CredentialsType::None)
CredentialsType m_type
Definition: virtru_credentials.h:75
issuer, tokenId, and secret
virtual ~Credentials()
Destructor.
virtual std::map< std::string, std::string > generateAuthHeaders(const std::string &url, const std::string &method, const std::string &body, const std::map< std::string, std::string > &headers, const std::string &date)
Definition: virtru_credentials.h:31
std::string getTypeStr() const
owner, apikey, and secret
virtual std::string getUserId() const
Get the userId associated with these credentials.
AppId and email address.
std::map< std::string, std::string > parseUrlTODO(const std::string &url) const
CredentialsType getType() const
default - no credentials specified