SlHelpers
Loading...
Searching...
No Matches
SSH.h
1// SPDX-License-Identifier: GPL-2.0-only
2
3#pragma once
4
5#include <filesystem>
6#include <string>
7#include <utility>
8#include <vector>
9
10namespace SlSSH {
11
15class Keys {
16public:
17 Keys() = delete;
18
20 using Key = std::filesystem::path;
22 using KeyPair = std::pair<Key, Key>;
24 using KeyPairs = std::vector<KeyPair>;
25
31 static KeyPairs get(const std::string &host) noexcept;
32private:
33 friend void testKeys();
34 static void replace(std::string &path, size_t &pos, std::string_view by) noexcept;
35 static Key handleTokens(std::string_view host, std::string path) noexcept;
36};
37
38}
std::pair< Key, Key > KeyPair
A pair of public + private keys (in that order).
Definition SSH.h:22
static KeyPairs get(const std::string &host) noexcept
Get keys for a host.
std::filesystem::path Key
One SSH key (a path to it).
Definition SSH.h:20
std::vector< KeyPair > KeyPairs
A list of key pairs.
Definition SSH.h:24