InnerLayer

Struct InnerLayer 

Source
pub struct InnerLayer {
    pub formats: Vec<u32>,
    pub intro_auth: Vec<String>,
    pub is_single_service: bool,
    pub introduction_points: Vec<IntroductionPointV3>,
}
Expand description

Inner encryption layer of a v3 hidden service descriptor.

The inner layer contains the actual service configuration and introduction points. It is encrypted within the outer layer.

§Structure

  • formats: Supported CREATE2 cell formats (typically [2] for ntor)
  • intro_auth: Required authentication methods for introduction
  • is_single_service: Whether this is a single-onion service
  • introduction_points: List of introduction point relays

§Decryption Requirements

To access the inner layer, you must first decrypt:

  1. The outer superencrypted blob using the blinded key and subcredential
  2. The inner encrypted blob using the descriptor cookie (if client auth)

§Single-Onion Services

If is_single_service is true, the service is running in single-onion mode, which provides lower latency but reduced anonymity for the service.

§Example

let inner = InnerLayer::parse(&decrypted_inner)?;

println!("CREATE2 formats: {:?}", inner.formats);
println!("Single-onion: {}", inner.is_single_service);
println!("Introduction points: {}", inner.introduction_points.len());

for intro in &inner.introduction_points {
    println!("  - {:?}", intro.link_specifiers);
}

Fields§

§formats: Vec<u32>

Supported CREATE2 cell formats (typically [2] for ntor handshake).

§intro_auth: Vec<String>

Required authentication methods for introduction (e.g., [“ed25519”]).

§is_single_service: bool

Whether this is a single-onion (non-anonymous) service.

§introduction_points: Vec<IntroductionPointV3>

List of introduction points for connecting to the service.

Implementations§

Source§

impl InnerLayer

Source

pub fn parse(content: &str) -> Result<Self, Error>

Parses the inner layer from decrypted content.

§Arguments
  • content - Decrypted inner layer content
§Returns

A parsed InnerLayer on success.

§Errors

Returns Error::Parse if the content is malformed or introduction points fail to parse.

§Example
// After decrypting both layers
let inner = InnerLayer::parse(&decrypted_content)?;

for intro in inner.introduction_points {
    // Connect to introduction points
}

Trait Implementations§

Source§

impl Clone for InnerLayer

Source§

fn clone(&self) -> InnerLayer

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 InnerLayer

Source§

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

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

impl PartialEq for InnerLayer

Source§

fn eq(&self, other: &InnerLayer) -> 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 InnerLayer

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.