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;
 
   48                                   std::string_view password);
 
   58  explicit PrivateKey(std::shared_ptr<NativeType> pkey)
 
   59      : pkey_(std::move(pkey)) {}
 
   61  std::shared_ptr<NativeType> pkey_{};