2019-05-26 06:52:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-09-28 08:45:15 +00:00
|
|
|
#include "config.h"
|
2020-04-16 12:31:57 +00:00
|
|
|
|
|
|
|
#if USE_SSL
|
2021-10-02 07:13:14 +00:00
|
|
|
# include <base/types.h>
|
2019-05-26 06:52:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-09-10 18:24:53 +00:00
|
|
|
|
|
|
|
/// Encodes `text` and returns it.
|
2022-07-14 16:11:35 +00:00
|
|
|
std::string encodeSHA256(std::string_view text);
|
2020-09-10 18:24:53 +00:00
|
|
|
std::string encodeSHA256(const void * text, size_t size);
|
|
|
|
/// `out` must be at least 32 bytes long.
|
2022-07-14 16:11:35 +00:00
|
|
|
void encodeSHA256(std::string_view text, unsigned char * out);
|
2020-09-10 18:24:53 +00:00
|
|
|
void encodeSHA256(const void * text, size_t size, unsigned char * out);
|
2019-05-26 06:52:29 +00:00
|
|
|
|
2019-05-26 19:30:23 +00:00
|
|
|
/// Returns concatenation of error strings for all errors that OpenSSL has recorded, emptying the error queue.
|
2019-05-26 06:52:29 +00:00
|
|
|
String getOpenSSLErrors();
|
|
|
|
|
|
|
|
}
|
2019-09-11 11:21:54 +00:00
|
|
|
#endif
|