ClickHouse/src/Functions/tryDecrypt.cpp

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

34 lines
659 B
C++
Raw Normal View History

#include <Common/FunctionDocumentation.h>
#include "config.h"
2022-10-03 10:06:54 +00:00
#if USE_SSL
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsAES.h>
namespace DB
{
2022-10-03 10:06:54 +00:00
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;
};
}
2022-10-03 10:46:20 +00:00
REGISTER_FUNCTION(TryDecrypt)
2022-10-03 10:06:54 +00:00
{
factory.registerFunction<FunctionDecrypt<TryDecryptImpl>>(FunctionDocumentation{
.description="Similar to `decrypt`, but returns NULL if decryption fails because of using the wrong key."});
2022-10-03 10:06:54 +00:00
}
}
#endif