pub struct AuthChallengeCell {
pub challenge: [u8; 32],
pub methods: Vec<u16>,
pub unused: Vec<u8>,
}Expand description
Authentication challenge cell.
AUTH_CHALLENGE cells are sent by relays to initiate optional client authentication. They contain a random challenge and list of supported authentication methods.
§Wire Format
Variable-size cell:
[ CircID (0) ][ 130 (AUTH_CHALLENGE) ][ Length ]
[ Challenge (32 bytes) ][ Method Count (2) ][ Methods (2 bytes each) ]Fields§
§challenge: [u8; 32]Random challenge bytes (32 bytes).
methods: Vec<u16>Supported authentication methods.
unused: Vec<u8>Unused trailing bytes.
Implementations§
Source§impl AuthChallengeCell
impl AuthChallengeCell
Sourcepub fn new(methods: Vec<u16>) -> Self
pub fn new(methods: Vec<u16>) -> Self
Creates a new AUTH_CHALLENGE cell with random challenge.
§Arguments
methods- Supported authentication methods
Sourcepub fn with_challenge(challenge: [u8; 32], methods: Vec<u16>) -> Self
pub fn with_challenge(challenge: [u8; 32], methods: Vec<u16>) -> Self
Creates an AUTH_CHALLENGE cell with a specific challenge.
§Arguments
challenge- 32-byte challenge valuemethods- Supported authentication methods
Trait Implementations§
Source§impl Clone for AuthChallengeCell
impl Clone for AuthChallengeCell
Source§fn clone(&self) -> AuthChallengeCell
fn clone(&self) -> AuthChallengeCell
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 Debug for AuthChallengeCell
impl Debug for AuthChallengeCell
Source§impl PartialEq for AuthChallengeCell
impl PartialEq for AuthChallengeCell
impl StructuralPartialEq for AuthChallengeCell
Auto Trait Implementations§
impl Freeze for AuthChallengeCell
impl RefUnwindSafe for AuthChallengeCell
impl Send for AuthChallengeCell
impl Sync for AuthChallengeCell
impl Unpin for AuthChallengeCell
impl UnwindSafe for AuthChallengeCell
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
Mutably borrows from an owned value. Read more