Struct saltyrtc_client::crypto::AuthToken [−][src]
pub struct AuthToken(_);
Wrapper for holding an auth token and encrypting / decrypting messages.
Methods
impl AuthToken
[src]
impl AuthToken
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new auth token.
This can fail only if libsodium initialization fails.
pub fn from_hex_str(hex_str: &str) -> SaltyResult<Self>
[src]
pub fn from_hex_str(hex_str: &str) -> SaltyResult<Self>
Create an AuthToken
instance from hex bytes.
pub fn from_slice(hex_str: &[u8]) -> SaltyResult<Self>
[src]
pub fn from_slice(hex_str: &[u8]) -> SaltyResult<Self>
Create an AuthToken
instance from a 32 byte slice.
pub fn secret_key(&self) -> &Key
[src]
pub fn secret_key(&self) -> &Key
Return a reference to the secret key.
pub fn secret_key_bytes(&self) -> &[u8]
[src]
pub fn secret_key_bytes(&self) -> &[u8]
Return a reference to the secret key bytes.
Trait Implementations
impl Debug for AuthToken
[src]
impl Debug for AuthToken
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for AuthToken
[src]
impl Clone for AuthToken
fn clone(&self) -> AuthToken
[src]
fn clone(&self) -> AuthToken
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for AuthToken
[src]
impl PartialEq for AuthToken
fn eq(&self, other: &AuthToken) -> bool
[src]
fn eq(&self, other: &AuthToken) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &AuthToken) -> bool
[src]
fn ne(&self, other: &AuthToken) -> bool
This method tests for !=
.
impl Eq for AuthToken
[src]
impl Eq for AuthToken