BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions
BeeeOn::PrivateKeyPassphraseProvider Class Reference

#include <SSLFacility.h>

Public Member Functions

 PrivateKeyPassphraseProvider (const std::string &passphrase)
 
 PrivateKeyPassphraseProvider (const std::string &passphrase, Poco::Mutex &lock)
 
void onRequest (const void *sender, std::string &passphrase)
 

Detailed Description

Passphrase provider intended for the next private key being load. If multiple private keys share the same passphrase (not recommended) then it is possible to reuse the created instance. It avoids collisions of passwords when multiple private keys are loaded by independent threads. Also it ensures that the given password is used for the private key until the provider instance is destroyed.

Typical usage:

{ PrivateKeyPassphraseProvider provider("secret passphrase"); Context::Ptr c = new Context(...); }

If a private key is being load by the Context it the provider provides the preset password. It is required that every Context creation is done by using the PrivateKeyPassphraseProvider or all such places share the same Mutex.


The documentation for this class was generated from the following files: