1
#pragma once
2

            
3
#include <memory>
4
#include <string>
5

            
6
#include "envoy/common/pure.h"
7
#include "envoy/ssl/private_key/private_key.h"
8

            
9
namespace Envoy {
10
namespace Ssl {
11

            
12
class TlsCertificateConfig {
13
public:
14
15878
  virtual ~TlsCertificateConfig() = default;
15

            
16
  /**
17
   * @return a string of the certificate name.
18
   */
19
  virtual const std::string& certificateName() const PURE;
20

            
21
  /**
22
   * @return a string of certificate chain.
23
   */
24
  virtual const std::string& certificateChain() const PURE;
25

            
26
  /**
27
   * @return path of the certificate chain used to identify the local side or "<inline>" if the
28
   * certificate chain was inlined.
29
   */
30
  virtual const std::string& certificateChainPath() const PURE;
31

            
32
  /**
33
   * @return a string of private key.
34
   */
35
  virtual const std::string& privateKey() const PURE;
36

            
37
  /**
38
   * @return path of the private key used to identify the local side or "<inline>" if the private
39
   * key was inlined.
40
   */
41
  virtual const std::string& privateKeyPath() const PURE;
42

            
43
  /**
44
   * @return a string of pkcs12 data.
45
   */
46
  virtual const std::string& pkcs12() const PURE;
47

            
48
  /**
49
   * @return path of the pkcs12 file used to identify the local side or "<inline>" if the pkcs12
50
   * data was inlined.
51
   */
52
  virtual const std::string& pkcs12Path() const PURE;
53

            
54
  /**
55
   * @return private key method provider.
56
   */
57
  virtual Envoy::Ssl::PrivateKeyMethodProviderSharedPtr privateKeyMethod() const PURE;
58

            
59
  /**
60
   * @return a string of password.
61
   */
62
  virtual const std::string& password() const PURE;
63

            
64
  /**
65
   * @return path of the password file to be used to decrypt the private key or "<inline>" if the
66
   * password was inlined.
67
   */
68
  virtual const std::string& passwordPath() const PURE;
69

            
70
  /**
71
   * @return a byte vector of ocsp response.
72
   */
73
  virtual const std::vector<uint8_t>& ocspStaple() const PURE;
74

            
75
  /**
76
   * @return path of the ocsp response file for this certificate or "<inline>" if the
77
   * ocsp response was inlined.
78
   */
79
  virtual const std::string& ocspStaplePath() const PURE;
80
};
81

            
82
using TlsCertificateConfigPtr = std::unique_ptr<TlsCertificateConfig>;
83

            
84
} // namespace Ssl
85
} // namespace Envoy