pub enum WepKey {
Wep40([u8; 5]),
Wep104([u8; 13]),
}
Expand description
WEP key.
IEEE Std 802.11-2016 describes two WEP key sizes: WEP-40 and WEP-104. Key
provides variants
for these standard key sizes represented as unencoded bytes.
Variants§
Wep40([u8; 5])
WEP-40 key. This is a partial key and is joined with an IV to form a 64-bit key.
Wep104([u8; 13])
WEP-104 key. This is a partial key and is joined with an IV to form a 128-bit key.
Implementations§
Source§impl WepKey
impl WepKey
Sourcepub fn parse(bytes: impl AsRef<[u8]>) -> Result<Self, WepError>
pub fn parse(bytes: impl AsRef<[u8]>) -> Result<Self, WepError>
Parses a WEP key from a byte sequence.
This function parses both unencoded keys and ASCII hexadecimal encoded keys. IEEE Std 802.11-2016 does not specify an encoding for non-hexadecimal keys, so the raw bytes are accepted as is, though these keys are typically ASCII or UTF-8 encoded text in practice. ASCII hexadecimal encoded keys are decoded into raw bytes.
Note that Key
does not provide a mechanism to restore the original byte sequence parsed
by this function, so the exact encoding of ASCII hexadecimal encoded keys may be lost.
§Errors
Returns an error if the size or encoding of the byte sequence is incompatible.
Trait Implementations§
Source§impl From<WepKey> for BareCredentials
impl From<WepKey> for BareCredentials
Conversion from a WEP key into bare credentials.
impl Eq for WepKey
impl StructuralPartialEq for WepKey
Auto Trait Implementations§
impl Freeze for WepKey
impl RefUnwindSafe for WepKey
impl Send for WepKey
impl Sync for WepKey
impl Unpin for WepKey
impl UnwindSafe for WepKey
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OptionalField for Twhere
T: ?Sized,
impl<T> OptionalField for Twhere
T: ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Upper case
letters are used (e.g. F9B4CA
)