pub struct ServerCtx { /* private fields */ }
Expand description
The server side of a security context
Implementations§
source§impl ServerCtx
impl ServerCtx
sourcepub fn new(cred: Cred) -> ServerCtx
pub fn new(cred: Cred) -> ServerCtx
Create a new uninitialized server context with the specified
credentials. You must then call step
until the context is
fully initialized. The mechanism is not specified because it
is dictated by the client.
sourcepub fn step(&mut self, tok: &[u8]) -> Result<Option<Buf>, Error>
pub fn step(&mut self, tok: &[u8]) -> Result<Option<Buf>, Error>
Perform 1 step in the initialization of the server context,
feeding it a token you received from the client. If
initialization is complete from the point of view of the
server then this will return Ok(None). Otherwise it will
return a token that needs to be sent to the client and fed to
ClientCtx::step
.
Trait Implementations§
source§impl SecurityContext for ServerCtx
impl SecurityContext for ServerCtx
source§fn wrap(&mut self, encrypt: bool, msg: &[u8]) -> Result<Buf, Error>
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>
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>
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>
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>
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>
fn info(&mut self) -> Result<CtxInfo, Error>
Get all information about a security context in one call
source§fn mechanism(&mut self) -> Result<&'static Oid, Error>
fn mechanism(&mut self) -> Result<&'static Oid, Error>
Get the mechanism of the security context
source§fn local(&mut self) -> Result<bool, Error>
fn local(&mut self) -> Result<bool, Error>
Return true if the security context was locally initiated
source§fn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Return true if the security context is fully initialized
impl Send for ServerCtx
impl Sync for ServerCtx
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more