Module onion_client_auth

Module onion_client_auth 

Source
Expand description

ONION_CLIENT_AUTH_VIEW response parsing.

This module parses responses from the ONION_CLIENT_AUTH_VIEW command, which lists client authentication credentials for v3 hidden services. These credentials allow access to hidden services that require client authentication.

§Response Format

A successful response lists credentials for one or all hidden services:

250-ONION_CLIENT_AUTH_VIEW [service_id]
250-CLIENT <service_id> <key_type>:<private_key> [ClientName=<name>] [Flags=<flags>]
250 OK

§Example

use stem_rs::response::{ControlMessage, OnionClientAuthViewResponse};

let response_text = "250-ONION_CLIENT_AUTH_VIEW\r\n\
                     250-CLIENT service1 x25519:privatekey123\r\n\
                     250 OK\r\n";
let msg = ControlMessage::from_str(response_text, None, false).unwrap();
let response = OnionClientAuthViewResponse::from_message(&msg).unwrap();

let cred = response.credentials.get("service1").unwrap();
assert_eq!(cred.key_type, "x25519");

§Security Considerations

  • Private keys should be handled securely and not logged
  • Credentials provide access to hidden services; protect them accordingly
  • The Permanent flag indicates credentials persist across Tor restarts

§See Also

Structs§

HiddenServiceCredential
Client authentication credential for a v3 hidden service.
OnionClientAuthViewResponse
Parsed response from the ONION_CLIENT_AUTH_VIEW command.