ClickHouse/src/Functions/tryDecrypt.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
637 B
C++
Raw Normal View History

2022-10-03 10:06:54 +00:00
#include <Common/Documentation.h>
#include "config.h"
2022-10-03 10:06:54 +00:00
#if USE_SSL
# include <Functions/FunctionFactory.h>
# include <Functions/FunctionsAES.h>
namespace
{
struct TryDecryptImpl
{
static constexpr auto name = "tryDecrypt";
static constexpr auto compatibility_mode = OpenSSLDetails::CompatibilityMode::OpenSSL;
static constexpr bool use_null_when_decrypt_fail = true;
};
}
namespace DB
{
2022-10-03 10:46:20 +00:00
REGISTER_FUNCTION(TryDecrypt)
2022-10-03 10:06:54 +00:00
{
2022-10-04 06:56:46 +00:00
factory.registerFunction<FunctionDecrypt<TryDecryptImpl>>(Documentation(
"Similar to `decrypt`, but returns NULL if decryption fails because of using the wrong key."));
2022-10-03 10:06:54 +00:00
}
}
#endif