pub struct RelayAuthenticator { /* private fields */ }
Expand description
Ed25519 authenticator with anti-replay protection
Implementations§
Source§impl RelayAuthenticator
impl RelayAuthenticator
Sourcepub fn with_key(signing_key: SigningKey) -> Self
pub fn with_key(signing_key: SigningKey) -> Self
Create an authenticator with a specific signing key
Sourcepub fn verifying_key(&self) -> &VerifyingKey
pub fn verifying_key(&self) -> &VerifyingKey
Get the public verifying key
Sourcepub fn create_token(
&self,
bandwidth_limit: u32,
timeout_seconds: u32,
) -> RelayResult<AuthToken>
pub fn create_token( &self, bandwidth_limit: u32, timeout_seconds: u32, ) -> RelayResult<AuthToken>
Create a new authentication token
Sourcepub fn verify_token(
&self,
token: &AuthToken,
peer_verifying_key: &VerifyingKey,
) -> RelayResult<()>
pub fn verify_token( &self, token: &AuthToken, peer_verifying_key: &VerifyingKey, ) -> RelayResult<()>
Verify an authentication token with anti-replay protection
Sourcepub fn set_max_token_age(&mut self, max_age_seconds: u64)
pub fn set_max_token_age(&mut self, max_age_seconds: u64)
Set maximum token age
Sourcepub fn max_token_age(&self) -> u64
pub fn max_token_age(&self) -> u64
Get maximum token age
Sourcepub fn clear_nonces(&self)
pub fn clear_nonces(&self)
Clear all used nonces (for testing)
Sourcepub fn nonce_count(&self) -> usize
pub fn nonce_count(&self) -> usize
Get number of used nonces (for testing)
Trait Implementations§
Source§impl Debug for RelayAuthenticator
impl Debug for RelayAuthenticator
Auto Trait Implementations§
impl Freeze for RelayAuthenticator
impl RefUnwindSafe for RelayAuthenticator
impl Send for RelayAuthenticator
impl Sync for RelayAuthenticator
impl Unpin for RelayAuthenticator
impl UnwindSafe for RelayAuthenticator
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