Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Cryptography/Providers/OpenSSL/Exception.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Cryptography_OpenSSL_Exception_h_
5#define _Stroika_Foundation_Cryptography_OpenSSL_Exception_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Common/Common.h"
10#include "Stroika/Foundation/Execution/Exceptions.h"
11#include "Stroika/Foundation/Memory/Common.h"
12
13/**
14 * \file
15 */
16
17namespace Stroika::Foundation::Cryptography::Providers::OpenSSL {
18
19#if qStroika_HasComponent_OpenSSL
20 /**
21 */
22 class Exception : public Execution::RuntimeErrorException<> {
23 private:
24 using inherited = Execution::RuntimeErrorException<>;
25
26 public:
27 /**
28 */
29 using InternalErrorCodeType = unsigned long;
30
31 public:
32 /**
33 */
34 Exception (InternalErrorCodeType errorCode);
35
36 public:
37 /**
38 */
39 nonvirtual InternalErrorCodeType GetErrorCode () const;
40
41 public:
42 /**
43 */
44 static Characters::String GetMessage (InternalErrorCodeType errorCode);
45
46 public:
47 /**
48 * ThrowLastErrorIfFailed throws if status is zero (usually 1 means good, but often APIs return something else for good cases)
49 */
50 static void ThrowLastErrorIfFailed (int status);
51
52 public:
53 /**
54 * ThrowLastError () throws error in ERR_get_error
55 */
56 [[noreturn]] static void ThrowLastError ();
57
58 public:
59 /**
60 */
61 static bool GetNamesSupported ();
62
63 public:
64 /**
65 */
66 static void SetNamesSupported (bool openSSLStringsSupported);
67
68 private:
69 InternalErrorCodeType fErrorCode_;
70 };
71#endif
72
73}
74
75/*
76 ********************************************************************************
77 ***************************** Implementation Details ***************************
78 ********************************************************************************
79 */
80#include "Exception.inl"
81
82#endif /*_Stroika_Foundation_Cryptography_OpenSSL_Exception_h_*/