pub enum TorAuthentication {
Null,
SafeCookie(Option<Vec<u8>>),
HashedPassword(String),
}
Expand description
Methods for Tor authentication:
- Null - No authentication
- SafeCookie -
SAFECOOKIE
authentication - HashedPassword - pass the hashed password to authenticate
With SafeCookie
auth, you can either pass in the cookie value as a binary vector, or, if you
pass in “None”, it will call the PROTOCOLINFO command to get the location of the cookie file,
and attempt to read that and pass the value to authenticate.
Note that we don’t support plain COOKIE
authentication, since that’s been determmined to be
unsafe.
Variants§
Implementations§
Source§impl TorAuthentication
impl TorAuthentication
Sourcepub async fn authenticate(
&self,
connection: &mut TorControlConnection,
) -> Result<(), TorError>
pub async fn authenticate( &self, connection: &mut TorControlConnection, ) -> Result<(), TorError>
Authenticate using this method to the server
Trait Implementations§
Source§impl Clone for TorAuthentication
impl Clone for TorAuthentication
Source§fn clone(&self) -> TorAuthentication
fn clone(&self) -> TorAuthentication
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TorAuthentication
impl Debug for TorAuthentication
Source§impl Default for TorAuthentication
impl Default for TorAuthentication
Source§fn default() -> TorAuthentication
fn default() -> TorAuthentication
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TorAuthentication
impl<'de> Deserialize<'de> for TorAuthentication
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TorAuthentication
impl Display for TorAuthentication
Auto Trait Implementations§
impl Freeze for TorAuthentication
impl RefUnwindSafe for TorAuthentication
impl Send for TorAuthentication
impl Sync for TorAuthentication
impl Unpin for TorAuthentication
impl UnwindSafe for TorAuthentication
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more