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

The server side of a security context

Implementations§

source§

impl ServerCtx

source

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.

source

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 Debug for ServerCtx

source§

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

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

impl Drop for ServerCtx

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl SecurityContext for ServerCtx

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 ServerCtx

source§

impl Sync for ServerCtx

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.