diff --git a/include/opendht/crypto.h b/include/opendht/crypto.h index 72eda3d57819bc106d46ed552c8584fc64aac837..17ef2b2d3614a746f78fe9fe0af713db1b4455a1 100644 --- a/include/opendht/crypto.h +++ b/include/opendht/crypto.h @@ -43,16 +43,22 @@ namespace dht { namespace crypto { class OPENDHT_PUBLIC CryptoException : public std::runtime_error { - public: - CryptoException(const std::string& str) : std::runtime_error(str) {}; +public: + explicit CryptoException(const std::string& str) : std::runtime_error(str) {}; + explicit CryptoException(const char* str) : std::runtime_error(str) {}; + CryptoException(const CryptoException& e) noexcept = default; + CryptoException& operator=(const CryptoException&) noexcept = default; }; /** * Exception thrown when a decryption error happened. */ class OPENDHT_PUBLIC DecryptError : public CryptoException { - public: - DecryptError(const std::string& str = "") : CryptoException(str) {}; +public: + explicit DecryptError(const std::string& str) : CryptoException(str) {}; + explicit DecryptError(const char* str) : CryptoException(str) {}; + DecryptError(const DecryptError& e) noexcept = default; + DecryptError& operator=(const DecryptError&) noexcept = default; }; struct PrivateKey;