Skip to main content

auto_detect_device_key

Function auto_detect_device_key 

Source
pub fn auto_detect_device_key(
    repo_opt: Option<&Path>,
    env_config: &EnvironmentConfig,
) -> Result<String>
Expand description

Auto-detect the device key alias when not explicitly provided.

Loads the identity from the repository, then lists all key aliases associated with that identity. Filters out --next- rotation keys, then either auto-selects (single key) or prompts interactively (multiple keys).

Args:

  • repo_opt: Optional path to the identity repository.
  • env_config: Environment configuration for keychain access.

Usage:

let alias = auto_detect_device_key(repo_opt.as_deref(), env_config)?;