Enum wlan_common::security::wpa::Wpa
source · pub enum Wpa<C = ()>where
C: CredentialData,{
Wpa1 {
credentials: <C::Personal as PersonalData>::Wpa1,
},
Wpa2 {
cipher: Option<Wpa2Cipher>,
authentication: Authentication<<C::Personal as PersonalData>::Wpa2, <C::Enterprise as EnterpriseData>::Wpa2>,
},
Wpa3 {
cipher: Option<Wpa3Cipher>,
authentication: Authentication<<C::Personal as PersonalData>::Wpa3, <C::Enterprise as EnterpriseData>::Wpa3>,
},
}
Expand description
General description of WPA and its authentication.
This type is typically used via the WpaAuthenticator
and WpaDescriptor
type
definitions, which represent WPA authenticators and descriptors, respectively. It is not
generally necessary to interact with this type directly.
This type constructor describes the configuration of a WPA security protocol and additionally
contains authentication (credential) data defined by its type parameter. For authenticators,
this data represents credentials, such as a PSK or passphrase. For descriptors, this data is
the unit type ()
, and so no authentication data is available. See the data
module and
CredentialData
trait for more.
Variants§
Wpa1
Fields
credentials: <C::Personal as PersonalData>::Wpa1
Wpa2
Fields
cipher: Option<Wpa2Cipher>
authentication: Authentication<<C::Personal as PersonalData>::Wpa2, <C::Enterprise as EnterpriseData>::Wpa2>
Wpa3
Fields
cipher: Option<Wpa3Cipher>
authentication: Authentication<<C::Personal as PersonalData>::Wpa3, <C::Enterprise as EnterpriseData>::Wpa3>
Implementations§
source§impl<C> Wpa<C>where
C: CredentialData,
impl<C> Wpa<C>where
C: CredentialData,
sourcepub fn into_descriptor(self) -> Wpa<()>
pub fn into_descriptor(self) -> Wpa<()>
Converts a Wpa
into a descriptor with no payload (the unit type ()
). Any payload (i.e.,
credentials) are dropped.
sourcepub fn cipher(&self) -> Option<Cipher>
pub fn cipher(&self) -> Option<Cipher>
Gets the configured cipher.
This function coalesces the ciphers supported by various versions of WPA and returns the
generalized Cipher
type.
Note that WPA1 is not configurable in this way and always uses TKIP (and so this function
will always return Some(Cipher::TKIP)
for WPA1). For other versions of WPA, the
configured cipher may not be known and this function returns None
in that case.
Importantly, this does not mean that no cipher is used, but rather that the specific
cipher is unspecified or unknown.
source§impl Wpa
impl Wpa
pub fn bind( self, credentials: BareCredentials, ) -> Result<WpaAuthenticator, SecurityError>
source§impl Wpa<AuthenticatorData>
impl Wpa<AuthenticatorData>
sourcepub fn into_credentials(self) -> Credentials
pub fn into_credentials(self) -> Credentials
Converts a WPA authenticator into its credentials.
The output of this function is general and describes all versions of WPA. This means it
cannot be used to determine which version of WPA has been specified. Note that WPA1
specifies its credentials as WPA1 Personal via Authentication::Personal
even though
WPA1 has no Enterprise suite.
pub fn to_credentials(&self) -> Credentials
Trait Implementations§
source§impl From<Wpa<AuthenticatorData>> for SecurityAuthenticator
impl From<Wpa<AuthenticatorData>> for SecurityAuthenticator
source§fn from(authenticator: WpaAuthenticator) -> Self
fn from(authenticator: WpaAuthenticator) -> Self
source§impl From<Wpa> for SecurityDescriptor
impl From<Wpa> for SecurityDescriptor
source§fn from(descriptor: WpaDescriptor) -> Self
fn from(descriptor: WpaDescriptor) -> Self
source§impl<C> PartialEq for Wpa<C>where
C: CredentialData,
impl<C> PartialEq for Wpa<C>where
C: CredentialData,
impl<C> Copy for Wpa<C>
impl<C> Eq for Wpa<C>where
C: CredentialData,
Auto Trait Implementations§
impl<C> Freeze for Wpa<C>where
<<C as CredentialData>::Personal as PersonalData>::Wpa1: Freeze,
<<C as CredentialData>::Personal as PersonalData>::Wpa2: Freeze,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa2: Freeze,
<<C as CredentialData>::Personal as PersonalData>::Wpa3: Freeze,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa3: Freeze,
impl<C> RefUnwindSafe for Wpa<C>where
<<C as CredentialData>::Personal as PersonalData>::Wpa1: RefUnwindSafe,
<<C as CredentialData>::Personal as PersonalData>::Wpa2: RefUnwindSafe,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa2: RefUnwindSafe,
<<C as CredentialData>::Personal as PersonalData>::Wpa3: RefUnwindSafe,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa3: RefUnwindSafe,
impl<C> Send for Wpa<C>where
<<C as CredentialData>::Personal as PersonalData>::Wpa1: Send,
<<C as CredentialData>::Personal as PersonalData>::Wpa2: Send,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa2: Send,
<<C as CredentialData>::Personal as PersonalData>::Wpa3: Send,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa3: Send,
impl<C> Sync for Wpa<C>where
<<C as CredentialData>::Personal as PersonalData>::Wpa1: Sync,
<<C as CredentialData>::Personal as PersonalData>::Wpa2: Sync,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa2: Sync,
<<C as CredentialData>::Personal as PersonalData>::Wpa3: Sync,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa3: Sync,
impl<C> Unpin for Wpa<C>where
<<C as CredentialData>::Personal as PersonalData>::Wpa1: Unpin,
<<C as CredentialData>::Personal as PersonalData>::Wpa2: Unpin,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa2: Unpin,
<<C as CredentialData>::Personal as PersonalData>::Wpa3: Unpin,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa3: Unpin,
impl<C> UnwindSafe for Wpa<C>where
<<C as CredentialData>::Personal as PersonalData>::Wpa1: UnwindSafe,
<<C as CredentialData>::Personal as PersonalData>::Wpa2: UnwindSafe,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa2: UnwindSafe,
<<C as CredentialData>::Personal as PersonalData>::Wpa3: UnwindSafe,
<<C as CredentialData>::Enterprise as EnterpriseData>::Wpa3: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)