/* * Copyright (C) 2018 ScyllaDB * */ /* * SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 */ #pragma once #include #include #include #include #include #include #include #include #include #include "../../bytes.hh" #include "symmetric_key.hh" namespace encryption { class symmetric_key; class encryption_context; struct key_info; class kmip_host { public: struct host_options { std::vector hosts; sstring username; sstring password; sstring certfile; sstring keyfile; sstring truststore; sstring priority_string; std::optional key_cache_expiry; std::optional key_cache_refresh; std::optional max_pooled_connections_per_host; std::optional max_command_retries; }; struct key_options { sstring template_name; sstring key_namespace; }; using id_type = bytes; kmip_host(encryption_context&, const sstring& name, const host_options&); kmip_host(encryption_context&, const sstring& name, const std::unordered_map&); ~kmip_host(); future<> connect(); future<> disconnect(); future, id_type>> get_or_create_key(const key_info&, const key_options& = {}); future> get_key_by_id(const id_type&, std::optional = std::nullopt); /** for system key(s) */ future> get_key_by_name(const sstring&); private: class impl; std::unique_ptr _impl; }; std::ostream& operator<<(std::ostream&, const kmip_host::key_options&); } template <> struct fmt::formatter : fmt::ostream_formatter {};