-
Notifications
You must be signed in to change notification settings - Fork 638
Expand file tree
/
Copy pathKeyData.h
More file actions
45 lines (35 loc) · 1.23 KB
/
KeyData.h
File metadata and controls
45 lines (35 loc) · 1.23 KB
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
40
41
42
43
44
/*
* Copyright (C) 1996-2026 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
#ifndef SQUID_SRC_SECURITY_KEYDATA_H
#define SQUID_SRC_SECURITY_KEYDATA_H
#include "anyp/forward.h"
#include "sbuf/SBuf.h"
#include "security/forward.h"
namespace Security
{
/// TLS certificate and private key details from squid.conf
class KeyData
{
public:
/// load the contents of certFile and privateKeyFile into memory cert, pkey and chain
void loadFromFiles(const AnyP::PortCfg &, const char *portType);
public:
SBuf certFile; ///< path of file containing PEM format X.509 certificate
SBuf privateKeyFile; ///< path of file containing private key in PEM format
/// public X.509 certificate from certFile
Security::CertPointer cert;
/// private key from privateKeyFile
Security::PrivateKeyPointer pkey;
/// any certificates which must be chained from cert
Security::CertList chain;
private:
bool loadCertificates();
bool loadX509PrivateKeyFromFile();
};
} // namespace Security
#endif /* SQUID_SRC_SECURITY_KEYDATA_H */