pub struct ExportedSessionKey { /* private fields */ }
Expand description
The exported session key.
This uses the same format as the SessionKey
minus the signature at the
end.
Implementations§
Source§impl ExportedSessionKey
impl ExportedSessionKey
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SessionKeyDecodeError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SessionKeyDecodeError>
Deserialize the ExportedSessionKey
from a byte slice.
Sourcepub fn to_base64(&self) -> String
pub fn to_base64(&self) -> String
Serialize the ExportedSessionKey
to a base64 encoded string.
This method will first use the ExportedSessionKey::to_bytes()
to
convert the session key to a byte vector and then encode the byte vector
to a string using unpadded base64 as the encoding.
Sourcepub fn from_base64(key: &str) -> Result<Self, SessionKeyDecodeError>
pub fn from_base64(key: &str) -> Result<Self, SessionKeyDecodeError>
Deserialize the ExportedSessionKey
from base64 encoded string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ExportedSessionKey
impl<'de> Deserialize<'de> for ExportedSessionKey
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Drop for ExportedSessionKey
impl Drop for ExportedSessionKey
Source§impl Serialize for ExportedSessionKey
impl Serialize for ExportedSessionKey
Source§impl TryFrom<&[u8]> for ExportedSessionKey
impl TryFrom<&[u8]> for ExportedSessionKey
Source§impl TryFrom<&str> for ExportedSessionKey
impl TryFrom<&str> for ExportedSessionKey
Auto Trait Implementations§
impl Freeze for ExportedSessionKey
impl RefUnwindSafe for ExportedSessionKey
impl Send for ExportedSessionKey
impl Sync for ExportedSessionKey
impl Unpin for ExportedSessionKey
impl UnwindSafe for ExportedSessionKey
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