libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
sshpp::KnownHosts Class Reference

#include <known_hosts.hpp>

Public Member Functions

 KnownHosts (std::filesystem::path user_file, std::filesystem::path global_file={})
 
Result< void > add (std::string_view host, std::uint16_t port, const Key &, std::string_view comment={})
 

Static Public Member Functions

static KnownHosts default_files ()
 
static Result< KnownHostsEntryparse_line (std::string_view host, std::string_view line)
 Parse a single line without touching any file (wraps ssh_known_hosts_parse_line).
 

Detailed Description

Direct manipulation of known_hosts files, independent of a live Session. See docs/design/04 ยง4.6.

Constructor & Destructor Documentation

◆ KnownHosts()

SSHPP_INLINE sshpp::KnownHosts::KnownHosts ( std::filesystem::path  user_file,
std::filesystem::path  global_file = {} 
)
explicit

Member Function Documentation

◆ default_files()

SSHPP_INLINE KnownHosts sshpp::KnownHosts::default_files ( )
static

◆ add()

SSHPP_INLINE Result< void > sshpp::KnownHosts::add ( std::string_view  host,
std::uint16_t  port,
const Key key,
std::string_view  comment = {} 
)

◆ parse_line()

SSHPP_INLINE Result< KnownHostsEntry > sshpp::KnownHosts::parse_line ( std::string_view  host,
std::string_view  line 
)
static

Parse a single line without touching any file (wraps ssh_known_hosts_parse_line).


The documentation for this class was generated from the following files: