Skip to main content

ClientConfig

Struct ClientConfig 

Source
pub struct ClientConfig {
    pub client_sap: u8,
    pub system_title: Option<SystemTitle>,
    pub mechanism: AuthMechanism,
    pub password: Option<Secret>,
    pub security: SecurityPolicy,
    pub max_pdu_size: u16,
    pub conformance: Conformance,
    pub referencing: Referencing,
    pub challenge_len: usize,
    pub invocation_counter: u32,
    pub replay_window: u32,
    pub gbt_window: u8,
}
Expand description

How the client identifies itself and what it demands.

Fields§

§client_sap: u8

The client service access point: 0x10 public, 0x20 reader, 0x30 management.

§system_title: Option<SystemTitle>

The client’s system title. Required for GMAC authentication and for any ciphered association, because it is half of every nonce the client sends under.

§mechanism: AuthMechanism

Which authentication mechanism to propose.

§password: Option<Secret>

The low-level-security password, or the high-level-security shared secret.

§security: SecurityPolicy

What protection to apply.

Set dedicated to propose a dedicated-key association; the key itself comes from the provider, and an association is refused rather than opened if the provider has none.

§max_pdu_size: u16

The largest APDU the client will accept.

§conformance: Conformance

What the client proposes it can do.

§referencing: Referencing

How objects are addressed.

§challenge_len: usize

How long a challenge to send. The Blue Book allows eight to sixty-four bytes; shorter is weaker and there is no reason to go below sixteen.

§invocation_counter: u32

The last invocation counter this client used before it started.

Zero is right only for a client that has never sent under these keys. Restarting from zero against an unchanged key reuses every nonce it used before, and a repeated GCM nonce leaks the authentication subkey. Persist ClientSession::invocation_counter and restore it here.

§replay_window: u32

How far out of order the server’s invocation counters may arrive.

Zero — strictly increasing — is right for HDLC and TCP.

§gbt_window: u8

How many general-block-transfer blocks this client takes before it acknowledges, announced to the server in every acknowledgement. Clamped to 1..=63.

Larger windows cost fewer round trips on a slow link and need nothing more: the blocks land in the caller’s buffer whatever the window.

Trait Implementations§

Source§

impl Clone for ClientConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientConfig

Source§

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

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

impl Default for ClientConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for ClientConfig

§

impl Freeze for ClientConfig
where InternalBitFlags: Freeze,

§

impl Move for ClientConfig

§

impl RefUnwindSafe for ClientConfig
where InternalBitFlags: RefUnwindSafe,

§

impl Send for ClientConfig
where InternalBitFlags: Send,

§

impl Sync for ClientConfig
where InternalBitFlags: Sync,

§

impl Unpin for ClientConfig
where InternalBitFlags: Unpin,

§

impl UnsafeUnpin for ClientConfig
where InternalBitFlags: UnsafeUnpin,

§

impl UnwindSafe for ClientConfig
where InternalBitFlags: UnwindSafe,

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.