2023-02-08 11:04:11 +00:00
|
|
|
//
|
|
|
|
// KeyFileHandler.h
|
|
|
|
//
|
|
|
|
// Library: NetSSL_OpenSSL
|
|
|
|
// Package: SSLCore
|
|
|
|
// Module: KeyFileHandler
|
|
|
|
//
|
|
|
|
// Definition of the KeyFileHandler class.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NetSSL_KeyFileHandler_INCLUDED
|
|
|
|
#define NetSSL_KeyFileHandler_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include "Poco/Net/NetSSL.h"
|
|
|
|
#include "Poco/Net/PrivateKeyPassphraseHandler.h"
|
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
namespace Poco
|
|
|
|
{
|
|
|
|
namespace Net
|
|
|
|
{
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
class NetSSL_API KeyFileHandler : public PrivateKeyPassphraseHandler
|
|
|
|
/// An implementation of PrivateKeyPassphraseHandler that
|
|
|
|
/// reads the key for a certificate from a configuration file
|
|
|
|
/// under the path "openSSL.privateKeyPassphraseHandler.options.password".
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
KeyFileHandler(bool server);
|
|
|
|
/// Creates the KeyFileHandler.
|
2023-02-08 11:04:11 +00:00
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
virtual ~KeyFileHandler();
|
|
|
|
/// Destroys the KeyFileHandler.
|
2023-02-08 11:04:11 +00:00
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
void onPrivateKeyRequested(const void * pSender, std::string & privateKey);
|
2023-02-08 11:04:11 +00:00
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
private:
|
|
|
|
static const std::string CFG_PRIV_KEY_FILE;
|
|
|
|
};
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
}
|
|
|
|
} // namespace Poco::Net
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif // NetSSL_KeyFileHandler_INCLUDED
|