pub struct ClientCtx { /* private fields */ }
Expand description
The client side of a security context
Implementations§
source§impl ClientCtx
impl ClientCtx
sourcepub fn new(
cred: Option<Cred>,
target: Name,
flags: CtxFlags,
mech: Option<&'static Oid>
) -> ClientCtx
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
.
sourcepub fn step(
&mut self,
tok: Option<&[u8]>,
channel_bindings: Option<&[u8]>
) -> Result<Option<Buf>, Error>
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 SecurityContext for ClientCtx
impl SecurityContext for ClientCtx
source§fn wrap(&mut self, encrypt: bool, msg: &[u8]) -> Result<Buf, Error>
fn wrap(&mut self, encrypt: bool, msg: &[u8]) -> Result<Buf, Error>
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>
fn wrap_iov( &mut self, encrypt: bool, msg: &mut [GssIov<'_>] ) -> Result<(), Error>
source§fn wrap_iov_length(
&mut self,
encrypt: bool,
msg: &mut [GssIovFake]
) -> Result<(), Error>
fn wrap_iov_length( &mut self, encrypt: bool, msg: &mut [GssIovFake] ) -> Result<(), Error>
wrap_iov
.