IntroductionPointV3

Struct IntroductionPointV3 

Source
pub struct IntroductionPointV3 {
    pub link_specifiers: Vec<LinkSpecifier>,
    pub onion_key_raw: Option<String>,
    pub auth_key_cert: Option<String>,
    pub enc_key_raw: Option<String>,
    pub enc_key_cert: Option<String>,
    pub legacy_key_raw: Option<String>,
    pub legacy_key_cert: Option<String>,
}
Expand description

Introduction point for a version 3 hidden service.

V3 introduction points use modern cryptography (Ed25519/X25519) and support multiple ways to specify the relay’s location via link specifiers.

§Fields

  • link_specifiers: How to connect to this introduction point
  • onion_key_raw: Base64 ntor key for the introduction handshake
  • auth_key_cert: Ed25519 certificate cross-certifying the signing key
  • enc_key_raw: Base64 encryption key for introduction requests
  • enc_key_cert: Ed25519 certificate for the encryption key
  • legacy_key_raw: Optional RSA key for backward compatibility
  • legacy_key_cert: Optional certificate for the legacy key

§Cryptographic Keys

Each introduction point has several keys:

  1. Onion Key: X25519 key for the ntor handshake with the intro point
  2. Auth Key: Ed25519 key that authenticates the introduction point
  3. Enc Key: X25519 key for encrypting the introduction request
  4. Legacy Key: Optional RSA key for older clients

§Example

let inner_layer = InnerLayer::parse(decrypted_content)?;

for intro_point in inner_layer.introduction_points {
    for spec in &intro_point.link_specifiers {
        match spec {
            LinkSpecifier::IPv4 { address, port } => {
                println!("Connect to {}:{}", address, port);
            }
            _ => {}
        }
    }
}

Fields§

§link_specifiers: Vec<LinkSpecifier>

Link specifiers describing how to connect to this introduction point.

§onion_key_raw: Option<String>

Base64-encoded X25519 public key for ntor handshake.

§auth_key_cert: Option<String>

Ed25519 certificate cross-certifying the signing key with the auth key.

§enc_key_raw: Option<String>

Base64-encoded X25519 public key for encrypting introduction requests.

§enc_key_cert: Option<String>

Ed25519 certificate cross-certifying the signing key by the encryption key.

§legacy_key_raw: Option<String>

Optional base64-encoded RSA public key for legacy clients.

§legacy_key_cert: Option<String>

Optional certificate for the legacy RSA key.

Implementations§

Source§

impl IntroductionPointV3

Source

pub fn encode(&self) -> String

Encodes this introduction point to its descriptor format.

Produces the text representation suitable for inclusion in a hidden service descriptor’s inner layer.

§Returns

A string containing the encoded introduction point.

§Example
use stem_rs::descriptor::hidden::{IntroductionPointV3, LinkSpecifier};

let intro = IntroductionPointV3 {
    link_specifiers: vec![LinkSpecifier::IPv4 {
        address: "1.2.3.4".to_string(),
        port: 9001,
    }],
    onion_key_raw: Some("AAAA...".to_string()),
    auth_key_cert: None,
    enc_key_raw: Some("BBBB...".to_string()),
    enc_key_cert: None,
    legacy_key_raw: None,
    legacy_key_cert: None,
};

let encoded = intro.encode();
assert!(encoded.contains("introduction-point"));

Trait Implementations§

Source§

impl Clone for IntroductionPointV3

Source§

fn clone(&self) -> IntroductionPointV3

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntroductionPointV3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for IntroductionPointV3

Source§

fn eq(&self, other: &IntroductionPointV3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for IntroductionPointV3

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.