Struct tor_netdoc::doc::hsdesc::HsDescBuilder

source ·
pub struct HsDescBuilder<'a> { /* private fields */ }
Available on crate features hs-common and hs-service only.
Expand description

Builder for HsDesc.

Implementations§

source§

impl<'a> HsDescBuilder<'a>

source

pub fn blinded_id(self, value: &'a HsBlindIdKey) -> Self

The blinded hidden service public key used for the first half of the “SECRET_DATA” field.

(See rend-spec v3 2.5.1.1 and 2.5.2.1.)

source

pub fn hs_desc_sign(self, value: &'a Keypair) -> Self

The short-term descriptor signing key (KP_hs_desc_sign, KS_hs_desc_sign).

source

pub fn hs_desc_sign_cert(self, value: EncodedEd25519Cert) -> Self

The descriptor signing key certificate.

This certificate can be created using create_desc_sign_key_cert.

source

pub fn create2_formats(self, value: &'a [HandshakeType]) -> Self

A list of recognized CREATE handshakes that this onion service supports.

source

pub fn auth_required(self, value: Option<SmallVec<[IntroAuthType; 2]>>) -> Self

A list of authentication types that this onion service supports.

source

pub fn is_single_onion_service(self, value: bool) -> Self

If true, this a “single onion service” and is not trying to keep its own location private.

source

pub fn intro_points(self, value: &'a [IntroPointDesc]) -> Self

One or more introduction points used to contact the onion service.

source

pub fn intro_auth_key_cert_expiry(self, value: SystemTime) -> Self

The expiration time of an introduction point authentication key certificate.

source

pub fn intro_enc_key_cert_expiry(self, value: SystemTime) -> Self

The expiration time of an introduction point encryption key certificate.

source

pub fn auth_clients(self, value: Option<&'a [PublicKey]>) -> Self

The list of clients authorized to access the hidden service.

If None, client authentication is disabled. If Some(&[]), client authorization is enabled, but there will be no authorized clients.

If client authorization is disabled, the resulting middle document will contain a single auth-client line populated with random values.

Client authorization is disabled by default.

source

pub fn lifetime(self, value: IntegerMinutes<u16>) -> Self

The lifetime of this descriptor, in minutes.

This doesn’t actually list the starting time or the end time for the descriptor: presumably, because we didn’t want to leak the onion service’s view of the wallclock.

source

pub fn revision_counter(self, value: RevisionCounter) -> Self

A revision counter to tell whether this descriptor is more or less recent than another one for the same blinded ID.

source

pub fn subcredential(self, value: Subcredential) -> Self

The “subcredential” of the onion service.

Trait Implementations§

source§

impl<'a> Clone for HsDescBuilder<'a>

source§

fn clone(&self) -> HsDescBuilder<'a>

Returns a copy 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<'a> Debug for HsDescBuilder<'a>

source§

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

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

impl<'a> Default for HsDescBuilder<'a>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a> NetdocBuilder for HsDescBuilder<'a>

source§

fn build_sign<R: RngCore + CryptoRng>( self, rng: &mut R ) -> Result<String, EncodeError>

Build the document into textual form.

Auto Trait Implementations§

§

impl<'a> Freeze for HsDescBuilder<'a>

§

impl<'a> RefUnwindSafe for HsDescBuilder<'a>

§

impl<'a> Send for HsDescBuilder<'a>

§

impl<'a> Sync for HsDescBuilder<'a>

§

impl<'a> Unpin for HsDescBuilder<'a>

§

impl<'a> UnwindSafe for HsDescBuilder<'a>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more