1 | // |
2 | // KeyFileHandler.h |
3 | // |
4 | // Library: NetSSL_OpenSSL |
5 | // Package: SSLCore |
6 | // Module: KeyFileHandler |
7 | // |
8 | // Definition of the KeyFileHandler class. |
9 | // |
10 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. |
11 | // and Contributors. |
12 | // |
13 | // SPDX-License-Identifier: BSL-1.0 |
14 | // |
15 | |
16 | |
17 | #ifndef NetSSL_KeyFileHandler_INCLUDED |
18 | #define NetSSL_KeyFileHandler_INCLUDED |
19 | |
20 | |
21 | #include "Poco/Net/NetSSL.h" |
22 | #include "Poco/Net/PrivateKeyPassphraseHandler.h" |
23 | |
24 | |
25 | namespace Poco { |
26 | namespace Net { |
27 | |
28 | |
29 | class NetSSL_API KeyFileHandler: public PrivateKeyPassphraseHandler |
30 | /// An implementation of PrivateKeyPassphraseHandler that |
31 | /// reads the key for a certificate from a configuration file |
32 | /// under the path "openSSL.privateKeyPassphraseHandler.options.password". |
33 | { |
34 | public: |
35 | KeyFileHandler(bool server); |
36 | /// Creates the KeyFileHandler. |
37 | |
38 | virtual ~KeyFileHandler(); |
39 | /// Destroys the KeyFileHandler. |
40 | |
41 | void onPrivateKeyRequested(const void* pSender, std::string& privateKey); |
42 | |
43 | private: |
44 | static const std::string CFG_PRIV_KEY_FILE; |
45 | }; |
46 | |
47 | |
48 | } } // namespace Poco::Net |
49 | |
50 | |
51 | #endif // NetSSL_KeyFileHandler_INCLUDED |
52 | |