KeyFileHandler.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef NetSSL_KeyFileHandler_INCLUDED
  16. #define NetSSL_KeyFileHandler_INCLUDED
  17. #include "Poco/Net/NetSSL.h"
  18. #include "Poco/Net/PrivateKeyPassphraseHandler.h"
  19. namespace Poco {
  20. namespace Net {
  21. class NetSSL_API KeyFileHandler: public PrivateKeyPassphraseHandler
  22. /// An implementation of PrivateKeyPassphraseHandler that
  23. /// reads the key for a certificate from a configuration file
  24. /// under the path "openSSL.privateKeyPassphraseHandler.options.password".
  25. {
  26. public:
  27. KeyFileHandler(bool server);
  28. /// Creates the KeyFileHandler.
  29. virtual ~KeyFileHandler();
  30. /// Destroys the KeyFileHandler.
  31. void onPrivateKeyRequested(const void* pSender, std::string& privateKey);
  32. private:
  33. static const std::string CFG_PRIV_KEY_FILE;
  34. };
  35. } } // namespace Poco::Net
  36. #endif // NetSSL_KeyFileHandler_INCLUDED