use anyhow::Result;
use std::path::PathBuf;
pub use authkeys_managed::{
authorized_keys_path, has_block, host_pubkeys, install_authorized_key, remove_authorized_key,
strip_block, validate_pubkey,
};
pub fn managed_key_path() -> PathBuf {
authkeys_managed::managed_key_path(&crate::settings::config_dir())
}
pub fn known_hosts_path() -> PathBuf {
authkeys_managed::known_hosts_path(&crate::settings::config_dir())
}
pub fn ensure_managed_key() -> Result<String> {
authkeys_managed::ensure_managed_key(&crate::settings::config_dir())
}
pub fn pin_host_keys(dest_token: &str, hostkeys: &[String]) -> Result<()> {
authkeys_managed::pin_host_keys(&crate::settings::config_dir(), dest_token, hostkeys)
}
pub fn host_pinned(dest_token: &str) -> bool {
authkeys_managed::host_pinned(&crate::settings::config_dir(), dest_token)
}
pub fn bootstrap_cache_get(device: &str) -> Option<Option<String>> {
authkeys_managed::bootstrap_cache_get(&crate::settings::config_dir(), device)
}
pub fn bootstrap_cache_put(device: &str, user: Option<&str>) {
authkeys_managed::bootstrap_cache_put(&crate::settings::config_dir(), device, user)
}
pub fn bootstrap_cache_clear(device: &str) {
authkeys_managed::bootstrap_cache_clear(&crate::settings::config_dir(), device)
}