pub struct HsClientDescEncKey(/* private fields */);Expand description
Client service discovery key, used for onion descriptor
decryption. (KP_hsc_desc_enc)
Any client who knows the secret key corresponding to this key can decrypt the inner layer of the onion service descriptor.
The Display and FromStr representation of keys of this type is
descriptor:x25519:<base32-encoded-x25519-public-key>.
Note: the base32 encoding of the key is unpadded and case-insensitive,
for compatibility with the format accepted by C Tor.
See also CLIENT AUTHORIZATION in tor(1).
§Example
// A client service discovery key for connecting
// to a service running in restricted discovery mode,
// with an uppercase base32 encoding for the key material.
const CLIENT_KEY1: &str = "descriptor:x25519:ZPRRMIV6DV6SJFL7SFBSVLJ5VUNPGCDFEVZ7M23LTLVTCCXJQBKA";
// An identical key using lowercase base32 encoding for the key material.
const CLIENT_KEY2: &str = "descriptor:x25519:zprrmiv6dv6sjfl7sfbsvlj5vunpgcdfevz7m23ltlvtccxjqbka";
// Both key encodings parse successfully
let key1 = HsClientDescEncKey::from_str(CLIENT_KEY1).unwrap();
let key2 = HsClientDescEncKey::from_str(CLIENT_KEY2).unwrap();
// The keys are identical
assert_eq!(key1, key2);Trait Implementations§
Source§impl AsRef<PublicKey> for HsClientDescEncKey
impl AsRef<PublicKey> for HsClientDescEncKey
Source§impl Clone for HsClientDescEncKey
impl Clone for HsClientDescEncKey
Source§fn clone(&self) -> HsClientDescEncKey
fn clone(&self) -> HsClientDescEncKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstantTimeEq for HsClientDescEncKeywhere
PublicKey: ConstantTimeEq,
impl ConstantTimeEq for HsClientDescEncKeywhere
PublicKey: ConstantTimeEq,
Source§impl Debug for HsClientDescEncKey
impl Debug for HsClientDescEncKey
Source§impl Deref for HsClientDescEncKey
impl Deref for HsClientDescEncKey
Source§impl Display for HsClientDescEncKey
impl Display for HsClientDescEncKey
Source§impl From<&HsClientDescEncKeypair> for HsClientDescEncKey
impl From<&HsClientDescEncKeypair> for HsClientDescEncKey
Source§fn from(ks: &HsClientDescEncKeypair) -> Self
fn from(ks: &HsClientDescEncKeypair) -> Self
Converts to this type from the input type.
Source§impl From<&HsClientDescEncSecretKey> for HsClientDescEncKey
impl From<&HsClientDescEncSecretKey> for HsClientDescEncKey
Source§fn from(ks: &HsClientDescEncSecretKey) -> Self
fn from(ks: &HsClientDescEncSecretKey) -> Self
Converts to this type from the input type.
Source§impl From<HsClientDescEncKey> for PublicKey
impl From<HsClientDescEncKey> for PublicKey
Source§fn from(value: HsClientDescEncKey) -> Self
fn from(value: HsClientDescEncKey) -> Self
Converts to this type from the input type.
Source§impl From<PublicKey> for HsClientDescEncKey
impl From<PublicKey> for HsClientDescEncKey
Source§impl FromStr for HsClientDescEncKey
impl FromStr for HsClientDescEncKey
Source§impl PartialEq for HsClientDescEncKeywhere
HsClientDescEncKey: ConstantTimeEq,
impl PartialEq for HsClientDescEncKeywhere
HsClientDescEncKey: ConstantTimeEq,
impl Eq for HsClientDescEncKey
Auto Trait Implementations§
impl Freeze for HsClientDescEncKey
impl RefUnwindSafe for HsClientDescEncKey
impl Send for HsClientDescEncKey
impl Sync for HsClientDescEncKey
impl Unpin for HsClientDescEncKey
impl UnwindSafe for HsClientDescEncKey
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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 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>
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