aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/poco/NetSSL_OpenSSL/src/PrivateKeyPassphraseHandler.cpp
blob: 1d44e68a1eb5abbcce3786a83028a4fdd3a83379 (plain) (blame)
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
45
46
// 
// PrivateKeyPassphraseHandler.cpp 
// 
// Library: NetSSL_OpenSSL 
// Package: SSLCore 
// Module:  PrivateKeyPassphraseHandler 
// 
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 
// and Contributors. 
// 
// SPDX-License-Identifier:	BSL-1.0 
// 
 
 
#include "Poco/Net/PrivateKeyPassphraseHandler.h" 
#include "Poco/Net/SSLManager.h" 
#include "Poco/Delegate.h" 
 
 
using Poco::Delegate; 
 
 
namespace Poco { 
namespace Net { 
 
 
PrivateKeyPassphraseHandler::PrivateKeyPassphraseHandler(bool onServerSide): _serverSide(onServerSide) 
{ 
	SSLManager::instance().PrivateKeyPassphraseRequired += Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested); 
} 
 
 
PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler() 
{ 
	try 
	{ 
		SSLManager::instance().PrivateKeyPassphraseRequired -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested); 
	} 
	catch (...) 
	{ 
		poco_unexpected(); 
	} 
} 
 
 
} } // namespace Poco::Net