pub struct ClientCtx { /* private fields */ }
Expand description

The client side of a security context

Implementations§

source§

impl ClientCtx

source

pub fn new( cred: Option<Cred>, target: Name, flags: CtxFlags, mech: Option<&'static Oid> ) -> ClientCtx

Create a new uninitialized client security context using the specified credentials, targeting the service named by target, and optionally using a specific mechanism (otherwise gssapi will pick a default for you). To finish initializing the context you must call step.

source

pub fn step( &mut self, tok: Option<&[u8]>, channel_bindings: Option<&[u8]> ) -> Result<Option<Buf>, Error>

Perform 1 step in the initialization of the specfied security context. Since the client initiates context creation, the token will initially be None. If the connection uses channel bindings, they are passed as the second argument.

As a result this step, GSSAPI will give you a token to send to the server. The server may send back a token, which you must feed to this function, and possibly get another token to send to the server. This will go on a mechanism specifiec number of times until step returns Ok(None). At that point the context is fully initialized.

Trait Implementations§

source§

impl Debug for ClientCtx

source§

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

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

impl Drop for ClientCtx

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl SecurityContext for ClientCtx

source§

fn wrap(&mut self, encrypt: bool, msg: &[u8]) -> Result<Buf, Error>

Wrap a message with optional encryption. If encrypt is true then only the other side of the context can read the message. In any case the other side can always verify message integrity.
source§

fn wrap_iov( &mut self, encrypt: bool, msg: &mut [GssIov<'_>] ) -> Result<(), Error>

From the MIT kerberos documentation, Read more
source§

fn wrap_iov_length( &mut self, encrypt: bool, msg: &mut [GssIovFake] ) -> Result<(), Error>

This will set the required length of all the buffers except the data buffer, which must be provided as it will be to wrap_iov. The value of the encrypt flag must match what you pass to wrap_iov.
source§

fn unwrap(&mut self, msg: &[u8]) -> Result<Buf, Error>

Unwrap a wrapped message, checking it’s integrity and decrypting it if necessary.
source§

fn unwrap_iov(&mut self, msg: &mut [GssIov<'_>]) -> Result<(), Error>

From the MIT Kerberos documentation, Read more
source§

fn info(&mut self) -> Result<CtxInfo, Error>

Get all information about a security context in one call
source§

fn source_name(&mut self) -> Result<Name, Error>

Get the source name of the security context
source§

fn target_name(&mut self) -> Result<Name, Error>

Get the target name of the security context
source§

fn lifetime(&mut self) -> Result<Duration, Error>

Get the lifetime of the security context
source§

fn mechanism(&mut self) -> Result<&'static Oid, Error>

Get the mechanism of the security context
source§

fn flags(&mut self) -> Result<CtxFlags, Error>

Get the flags of the security context
source§

fn local(&mut self) -> Result<bool, Error>

Return true if the security context was locally initiated
source§

fn open(&mut self) -> Result<bool, Error>

Return true if the security context is open
source§

fn is_complete(&self) -> bool

Return true if the security context is fully initialized
source§

impl Send for ClientCtx

source§

impl Sync for ClientCtx

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

§

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.