pub struct TorServiceId(/* private fields */);
Expand description
The service ID for the onion service.
Basically the service ID is the part of the onion address before the “.onion” part. This is an encoding of the onion service’s public key into a string. As such, you can convert from the service ID to the public key, and vice-versa.
Implementations§
Source§impl TorServiceId
impl TorServiceId
Sourcepub fn generate() -> Self
pub fn generate() -> Self
Generate a new ED25519 public key, and the corresponding TorServiceId
Sourcepub fn verifying_key(&self) -> Result<VerifyingKey, TorError>
pub fn verifying_key(&self) -> Result<VerifyingKey, TorError>
Retrieve the public ED25519 verifying key from the TorServiceId
pub fn as_str(&self) -> &str
pub fn short_id(&self) -> &str
Sourcepub fn onion_hostname(&self) -> String
pub fn onion_hostname(&self) -> String
Generate the corresponding onion hostname (by tacking on the “.onion” part)
Trait Implementations§
Source§impl Clone for TorServiceId
impl Clone for TorServiceId
Source§fn clone(&self) -> TorServiceId
fn clone(&self) -> TorServiceId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TorServiceId
impl Debug for TorServiceId
Source§impl<'de> Deserialize<'de> for TorServiceId
impl<'de> Deserialize<'de> for TorServiceId
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>,
Source§impl Display for TorServiceId
impl Display for TorServiceId
Source§impl Drop for TorServiceId
impl Drop for TorServiceId
Source§impl From<TorServiceId> for String
Convert the service ID to a String
impl From<TorServiceId> for String
Convert the service ID to a String
Source§fn from(id: TorServiceId) -> String
fn from(id: TorServiceId) -> String
Source§impl From<VerifyingKey> for TorServiceId
Generate the Tor service ID from an ed25519_dalek verifying (public) key
From section 6 of https://github.com/torproject/torspec/blob/main/rend-spec-v3.txt
impl From<VerifyingKey> for TorServiceId
Generate the Tor service ID from an ed25519_dalek verifying (public) key From section 6 of https://github.com/torproject/torspec/blob/main/rend-spec-v3.txt
Source§fn from(verifying_key: VerifyingKey) -> Self
fn from(verifying_key: VerifyingKey) -> Self
Source§impl FromStr for TorServiceId
Parse a String into a service ID. Note that this does a good bit of verification that the
service ID is indeed a service ID
impl FromStr for TorServiceId
Parse a String into a service ID. Note that this does a good bit of verification that the service ID is indeed a service ID