Struct tor_netdoc::doc::hsdesc::HsDescBuilder
source · pub struct HsDescBuilder<'a> { /* private fields */ }
hs-common
and hs-service
only.Expand description
Builder for HsDesc
.
Implementations§
source§impl<'a> HsDescBuilder<'a>
impl<'a> HsDescBuilder<'a>
sourcepub fn blinded_id(self, value: &'a HsBlindIdKey) -> Self
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.)
sourcepub fn hs_desc_sign(self, value: &'a Keypair) -> Self
pub fn hs_desc_sign(self, value: &'a Keypair) -> Self
The short-term descriptor signing key (KP_hs_desc_sign, KS_hs_desc_sign).
sourcepub fn hs_desc_sign_cert(self, value: EncodedEd25519Cert) -> Self
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
.
sourcepub fn create2_formats(self, value: &'a [HandshakeType]) -> Self
pub fn create2_formats(self, value: &'a [HandshakeType]) -> Self
A list of recognized CREATE handshakes that this onion service supports.
sourcepub fn auth_required(self, value: Option<SmallVec<[IntroAuthType; 2]>>) -> Self
pub fn auth_required(self, value: Option<SmallVec<[IntroAuthType; 2]>>) -> Self
A list of authentication types that this onion service supports.
sourcepub fn is_single_onion_service(self, value: bool) -> Self
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.
sourcepub fn intro_points(self, value: &'a [IntroPointDesc]) -> Self
pub fn intro_points(self, value: &'a [IntroPointDesc]) -> Self
One or more introduction points used to contact the onion service.
sourcepub fn intro_auth_key_cert_expiry(self, value: SystemTime) -> Self
pub fn intro_auth_key_cert_expiry(self, value: SystemTime) -> Self
The expiration time of an introduction point authentication key certificate.
sourcepub fn intro_enc_key_cert_expiry(self, value: SystemTime) -> Self
pub fn intro_enc_key_cert_expiry(self, value: SystemTime) -> Self
The expiration time of an introduction point encryption key certificate.
sourcepub fn auth_clients(self, value: Option<&'a [PublicKey]>) -> Self
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.
sourcepub fn lifetime(self, value: IntegerMinutes<u16>) -> Self
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.
sourcepub fn revision_counter(self, value: RevisionCounter) -> Self
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.
sourcepub fn subcredential(self, value: Subcredential) -> Self
pub fn subcredential(self, value: Subcredential) -> Self
The “subcredential” of the onion service.
Trait Implementations§
source§impl<'a> Clone for HsDescBuilder<'a>
impl<'a> Clone for HsDescBuilder<'a>
source§fn clone(&self) -> HsDescBuilder<'a>
fn clone(&self) -> HsDescBuilder<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for HsDescBuilder<'a>
impl<'a> Debug for HsDescBuilder<'a>
source§impl<'a> Default for HsDescBuilder<'a>
impl<'a> Default for HsDescBuilder<'a>
source§impl<'a> NetdocBuilder for HsDescBuilder<'a>
impl<'a> NetdocBuilder for HsDescBuilder<'a>
source§fn build_sign<R: RngCore + CryptoRng>(
self,
rng: &mut R
) -> Result<String, EncodeError>
fn build_sign<R: RngCore + CryptoRng>( self, rng: &mut R ) -> Result<String, EncodeError>
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> 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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