Skip to main content

PublicKeyAuth

Struct PublicKeyAuth 

Source
pub(crate) struct PublicKeyAuth {
    pub(crate) global_paths: &'static [&'static str],
    pub(crate) user_dir: &'static str,
    pub(crate) deny_root_login: bool,
    pub(crate) global_keys: Vec<AuthorizedKey>,
    pub(crate) global_fingerprint: u64,
}

Fields§

§global_paths: &'static [&'static str]§user_dir: &'static str§deny_root_login: bool§global_keys: Vec<AuthorizedKey>§global_fingerprint: u64

Implementations§

Source§

impl PublicKeyAuth

Source

pub(crate) fn from_paths( global_paths: &'static [&'static str], user_dir: &'static str, deny_root_login: bool, ) -> Self

Builds a value from paths.

Source

pub(crate) fn reload_global(&mut self) -> bool

Implements reload global.

Source

pub(crate) fn load_keys_from_paths(paths: &[&str]) -> Vec<AuthorizedKey>

Implements load keys from paths.

Source

pub(crate) fn load_user_keys(&self, username: &[u8]) -> Vec<AuthorizedKey>

Implements load user keys.

Source

pub(crate) fn sanitize_username(username: &[u8]) -> Option<String>

Implements sanitize username.

Source

pub(crate) fn parse_authorized_keys(data: &[u8], out: &mut Vec<AuthorizedKey>)

Parses authorized keys.

Source

pub(crate) fn find_algo_index(tokens: &[&str]) -> Option<usize>

Implements find algo index.

Source

pub(crate) fn looks_like_algo(token: &str) -> bool

Implements looks like algo.

Source

pub(crate) fn matches( keys: &[AuthorizedKey], algorithm: &[u8], public_key: &[u8], ) -> bool

Implements matches.

Source

pub(crate) fn keys_fingerprint(keys: &[AuthorizedKey]) -> u64

Implements keys fingerprint.

Trait Implementations§

Source§

impl AuthProvider for PublicKeyAuth

Source§

fn authorize_public_key( &mut self, username: &[u8], algorithm: &[u8], public_key: &[u8], _signed_data: &[u8], _signature: &[u8], ) -> Result<bool>

Implements authorize public key.

Auto Trait Implementations§

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.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.