1 //
2 // CryptoException.h
3 //
4 //
5 // Library: Crypto
6 // Package: Crypto
7 // Module:  CryptoException
8 //
9 // Definition of the CryptoException class.
10 //
11 // Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
12 // and Contributors.
13 //
14 // SPDX-License-Identifier:	BSL-1.0
15 //
16 
17 
18 #ifndef Crypto_CryptoException_INCLUDED
19 #define Crypto_CryptoException_INCLUDED
20 
21 
22 #include "Poco/Crypto/Crypto.h"
23 #include "Poco/Exception.h"
24 
25 
26 namespace Poco {
27 namespace Crypto {
28 
29 
POCO_DECLARE_EXCEPTION(Crypto_API,CryptoException,Poco::Exception)30 POCO_DECLARE_EXCEPTION(Crypto_API, CryptoException, Poco::Exception)
31 
32 
33 class Crypto_API OpenSSLException : public CryptoException
34 {
35 public:
36 	OpenSSLException(int code = 0);
37 	OpenSSLException(const std::string& msg, int code = 0);
38 	OpenSSLException(const std::string& msg, const std::string& arg, int code = 0);
39 	OpenSSLException(const std::string& msg, const Poco::Exception& exc, int code = 0);
40 	OpenSSLException(const OpenSSLException& exc);
41 	~OpenSSLException() noexcept;
42 	OpenSSLException& operator = (const OpenSSLException& exc);
43 	const char* name() const noexcept;
44 	const char* className() const noexcept;
45 	Poco::Exception* clone() const;
46 	void rethrow() const;
47 
48 private:
49 	void setExtMessage();
50 };
51 
52 
53 } } // namespace Poco::Crypto
54 
55 
56 #endif // Crypto_CryptoException_INCLUDED
57