| 1 | // |
| 2 | // KeyConsoleHandler.cpp |
| 3 | // |
| 4 | // Library: NetSSL_OpenSSL |
| 5 | // Package: SSLCore |
| 6 | // Module: KeyConsoleHandler |
| 7 | // |
| 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. |
| 9 | // and Contributors. |
| 10 | // |
| 11 | // SPDX-License-Identifier: BSL-1.0 |
| 12 | // |
| 13 | |
| 14 | |
| 15 | #include "Poco/Net/KeyConsoleHandler.h" |
| 16 | #include <iostream> |
| 17 | |
| 18 | |
| 19 | namespace Poco { |
| 20 | namespace Net { |
| 21 | |
| 22 | |
| 23 | KeyConsoleHandler::KeyConsoleHandler(bool server):PrivateKeyPassphraseHandler(server) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | |
| 28 | KeyConsoleHandler::~KeyConsoleHandler() |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | |
| 33 | void KeyConsoleHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey) |
| 34 | { |
| 35 | std::cout << "Please enter the passphrase for the private key: " ; |
| 36 | std::cin >> privateKey; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | } } // namespace Poco::Net |
| 41 | |