11#include <userver/crypto/basic_types.hpp>
13USERVER_NAMESPACE_BEGIN
22 using NativeType = EVP_PKEY;
24 PrivateKey() =
default;
26 NativeType* GetNative()
const noexcept {
return pkey_.get(); }
27 explicit operator
bool()
const noexcept {
return !!pkey_; }
34 std::optional<std::string>
GetPemString(std::string_view password)
const;
57 explicit PrivateKey(std::shared_ptr<NativeType> pkey) : pkey_(std::move(pkey)) {}
59 std::shared_ptr<NativeType> pkey_{};