pub fn create_api_key(
name: &str,
wallet_ids: &[String],
policy_ids: &[String],
passphrase: &str,
expires_at: Option<&str>,
vault_path: Option<&Path>,
) -> Result<(String, ApiKeyFile), OwsLibError>Expand description
Create an API key for agent access to one or more wallets.
- Authenticates with the owner’s passphrase
- Decrypts the mnemonic for each wallet
- Generates a random token (
ows_key_...) - Re-encrypts each mnemonic under HKDF(token)
- Stores the key file with token hash, policy IDs, and encrypted copies
- Returns the raw token (shown once to the user)