Struct ssh_packet::cryptography::PublickeySignature

source ·
pub struct PublickeySignature<'s> {
    pub session_id: &'s Bytes,
    pub username: &'s StringUtf8,
    pub service_name: &'s StringAscii,
    pub algorithm: &'s Bytes,
    pub blob: &'s Bytes,
}
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: &'s Bytes

The session identifier issued by the key-exchange.

§username: &'s StringUtf8

Username for the auth request.

§service_name: &'s StringAscii

Service name to query.

§algorithm: &'s Bytes

Public key algorithm’s name.

§blob: &'s Bytes

Public key blob.

Implementations§

source§

impl PublickeySignature<'_>

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<'s> BinWrite for PublickeySignature<'s>

§

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<'s> Clone for PublickeySignature<'s>

source§

fn clone(&self) -> PublickeySignature<'s>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'s> Debug for PublickeySignature<'s>

source§

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

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

impl<'s> WriteEndian for PublickeySignature<'s>

source§

const ENDIAN: EndianKind = _

The endianness of the type.

Auto Trait Implementations§

§

impl<'s> Freeze for PublickeySignature<'s>

§

impl<'s> RefUnwindSafe for PublickeySignature<'s>

§

impl<'s> Send for PublickeySignature<'s>

§

impl<'s> Sync for PublickeySignature<'s>

§

impl<'s> Unpin for PublickeySignature<'s>

§

impl<'s> UnwindSafe for PublickeySignature<'s>

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.