Struct Publickey

Source
pub struct Publickey<'b> {
    pub session_id: Bytes<'b>,
    pub username: Utf8<'b>,
    pub service_name: Ascii<'b>,
    pub algorithm: Bytes<'b>,
    pub blob: Bytes<'b>,
}
Expand description

The data that gets signed and verified to prove the possession of the said private key in the publickey authentication method, computed from the concatenation of the following.

see https://datatracker.ietf.org/doc/html/rfc4252#section-7.

Fields§

§session_id: Bytes<'b>

The session identifier issued by the key-exchange.

§username: Utf8<'b>

Username for the auth request.

§service_name: Ascii<'b>

Service name to query.

§algorithm: Bytes<'b>

Public key algorithm’s name.

§blob: Bytes<'b>

Public key blob.

Implementations§

Source§

impl Publickey<'_>

Source

pub fn verify<S, K: Verifier<S>>(&self, key: &K, signature: &S) -> Result<()>

Available on crate feature signature only.

Verify the structure against the provided signature with the key.

Source

pub fn sign<S, K: Signer<S>>(&self, key: &K) -> S

Available on crate feature signature only.

Sign the structure with the provided key to produce the signature.

Trait Implementations§

Source§

impl<'b> BinWrite for Publickey<'b>

Source§

type Args<'__binrw_generated_args_lifetime> = ()

The type used for the args parameter of write_args() and write_options(). Read more
Source§

fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>

Write Self to the writer using the given Endian and arguments. Read more
Source§

fn write<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self: WriteEndian, Self::Args<'a>: for<'a> Required,

Write Self to the writer using default arguments. Read more
Source§

fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming big-endian byte order. Read more
Source§

fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming little-endian byte order. Read more
Source§

fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek, Self: WriteEndian,

Write Self to the writer using the given arguments. Read more
Source§

fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming big-endian byte order, using the given arguments. Read more
Source§

fn write_le_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming little-endian byte order, using the given arguments. Read more
Source§

impl<'b> Debug for Publickey<'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b> WriteEndian for Publickey<'b>

Source§

const ENDIAN: EndianKind

The endianness of the type.

Auto Trait Implementations§

§

impl<'b> Freeze for Publickey<'b>

§

impl<'b> RefUnwindSafe for Publickey<'b>

§

impl<'b> Send for Publickey<'b>

§

impl<'b> Sync for Publickey<'b>

§

impl<'b> Unpin for Publickey<'b>

§

impl<'b> UnwindSafe for Publickey<'b>

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> Same for T

Source§

type Output = T

Should always be Self
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.