22 lines
455 B
C++
22 lines
455 B
C++
#pragma once
|
|
#include <openssl/bio.h>
|
|
|
|
namespace nkg::resource_traits::openssl {
|
|
|
|
struct bio_chain {
|
|
using handle_t = BIO*;
|
|
|
|
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 {
|
|
BIO_free_all(handle);
|
|
}
|
|
};
|
|
|
|
}
|