navicat-keygen-2023/common/resource_traits/openssl/evp_pkey_ctx.hpp
Double Sine 47c84363b5
make code compatible with openssl 3.x
Signed-off-by: Double Sine <xiao_ai_yu@live.cn>
2022-05-08 00:11:02 +08:00

22 lines
472 B
C++

#pragma once
#include <openssl/evp.h>
namespace nkg::resource_traits::openssl {
struct evp_pkey_ctx {
using handle_t = EVP_PKEY_CTX*;
static constexpr handle_t invalid_value = nullptr;
[[nodiscard]]
static bool is_valid(const handle_t& handle) noexcept {
return handle != invalid_value;
}
static void release(const handle_t& handle) noexcept {
EVP_PKEY_CTX_free(handle);
}
};
}