Utility.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Utility.h
  3. //
  4. // Library: NetSSL_OpenSSL
  5. // Package: SSLCore
  6. // Module: Utility
  7. //
  8. // Definition of the Utility class.
  9. //
  10. // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef NetSSL_Utility_INCLUDED
  16. #define NetSSL_Utility_INCLUDED
  17. #include "Poco/Net/NetSSL.h"
  18. #include "Poco/Net/Context.h"
  19. namespace Poco {
  20. namespace Net {
  21. class NetSSL_API Utility
  22. /// This class provides various helper functions for working
  23. /// with the OpenSSL library.
  24. {
  25. public:
  26. static Context::VerificationMode convertVerificationMode(const std::string& verMode);
  27. /// Non-case sensitive conversion of a string to a VerificationMode enum.
  28. /// If verMode is illegal an InvalidArgumentException is thrown.
  29. static std::string convertCertificateError(long errCode);
  30. /// Converts an SSL certificate handling error code into an error message.
  31. static std::string getLastError();
  32. /// Returns the last error from the error stack
  33. static void clearErrorStack();
  34. /// Clears the error stack
  35. };
  36. } } // namespace Poco::Net
  37. #endif // NetSSL_Utility_INCLUDED