diff options
Diffstat (limited to 'cpp/src/IceSSL/Util.h')
-rw-r--r-- | cpp/src/IceSSL/Util.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cpp/src/IceSSL/Util.h b/cpp/src/IceSSL/Util.h index 3e98050ee35..1ff3b12aab5 100644 --- a/cpp/src/IceSSL/Util.h +++ b/cpp/src/IceSSL/Util.h @@ -29,6 +29,37 @@ namespace IceSSL { +#ifdef ICE_CPP11_MAPPING +// +// Adapts the C++11 functions to C++98-like callbacks +// +class CertificateVerifier +{ +public: + + CertificateVerifier(std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)>); + bool verify(const NativeConnectionInfoPtr&); + +private: + + std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)> _verify; +}; +using CertificateVerifierPtr = std::shared_ptr<CertificateVerifier>; + +class PasswordPrompt +{ +public: + + PasswordPrompt(std::function<std::string()>); + std::string getPassword(); + +private: + + std::function<std::string()> _prompt; +}; +using PasswordPromptPtr = std::shared_ptr<PasswordPrompt>; +#endif + // // Constants for X509 certificate alt names (AltNameOther, AltNameORAddress, AltNameEDIPartyName and // AltNameObjectIdentifier) are not supported. |