64 Key& operator=(
Key&&) noexcept;
68 explicit operator
bool() const noexcept {
return native_ !=
nullptr; }
73 static Result<Key> from_public_file(
const std::filesystem::path&);
74 static Result<Key> from_public_base64(std::string_view b64, KeyType type);
75 static Result<Key> from_authorized_keys_line(std::string_view line);
77 Result<std::string> to_public_base64()
const;
78 Result<std::string> to_authorized_keys_line(std::string_view comment = {})
const;
79 Result<void> write_public_file(
const std::filesystem::path&)
const;
80 Result<Key> public_part()
const;
83 std::
string type_name() const;
84 int bits() const noexcept;
85 bool is_private() const noexcept;
86 bool is_public() const noexcept;
87 Result<Fingerprint> fingerprint(HashType = HashType::sha256) const;
88 bool equals(const Key& other,
bool compare_private = false) const noexcept;
90 static Result<Key> generate(KeyType,
int bits = 0);
93 explicit Key(native_key n,
bool owning) : native_(n), owning_(owning) {}