Struct argonautica::input::SecretKey [−][src]
pub struct SecretKey<'a> { /* fields omitted */ }
Type-safe struct representing the raw bytes of a secret key
Methods
impl<'a> SecretKey<'a>
[src]
impl<'a> SecretKey<'a>
pub fn from_base64_encoded<S>(s: S) -> Result<SecretKey<'static>, Error> where
S: AsRef<str>,
[src]
pub fn from_base64_encoded<S>(s: S) -> Result<SecretKey<'static>, Error> where
S: AsRef<str>,
Constructs a SecretKey
from a base64-encoded &str
(or anything
that can be dereferenced into a base64-encoded &str
) using the
standard base64 encoding.
pub fn from_base64_encoded_config<S>(
s: S,
config: Config
) -> Result<SecretKey<'static>, Error> where
S: AsRef<str>,
[src]
pub fn from_base64_encoded_config<S>(
s: S,
config: Config
) -> Result<SecretKey<'static>, Error> where
S: AsRef<str>,
Same as from_base64_encoded_str
except you can pass a value that uses a non-standard base64 encoding (e.g. a
url-safe encoding)
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
Read-only access to the underlying byte buffer
pub fn is_mutable(&self) -> bool
[src]
pub fn is_mutable(&self) -> bool
Indicates whether the underlying byte buffer is mutable or not. The underlying byte
buffer is mutable when the SecretKey
was constructed
from an owned value (such as a String
or a Vec<u8>
) or from a mutable reference
(such as a &mut str
or a &mut [u8]
). It is not mutable when the
SecretKey
was constructed from an immutable reference
(such as a &str
or a &[u8]
). The SecretKey
must be mutable
in order to hash or verify with the secret_key_clearing
configuration set to true
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Read-only acccess to the underlying byte buffer's length (in number of bytes)
pub fn to_owned(&self) -> SecretKey<'static>
[src]
pub fn to_owned(&self) -> SecretKey<'static>
Clones the underlying byte buffer and returns a new
SecretKey
with a static
lifetime. Use this method if you
would like to move a SecretKey
to another thread
pub fn to_base64_encoded(&self) -> String
[src]
pub fn to_base64_encoded(&self) -> String
Returns the underlying byte buffer as a base64-encoded String
using
standard base64 encoding
pub fn to_base64_encoded_config(&self, config: Config) -> String
[src]
pub fn to_base64_encoded_config(&self, config: Config) -> String
Returns the underlying byte buffer as a base64-encoded String
using
a custom base64 encoding (e.g. a url-safe encoding)
pub fn to_str(&self) -> Result<&str, Error>
[src]
pub fn to_str(&self) -> Result<&str, Error>
Read-only access to the underlying byte buffer as a &str
if its bytes are valid utf-8
Trait Implementations
impl<'a> From<&'a str> for SecretKey<'a>
[src]
impl<'a> From<&'a str> for SecretKey<'a>
impl<'a> From<&'a mut str> for SecretKey<'a>
[src]
impl<'a> From<&'a mut str> for SecretKey<'a>
impl<'a> From<&'a String> for SecretKey<'a>
[src]
impl<'a> From<&'a String> for SecretKey<'a>
impl<'a> From<&'a mut String> for SecretKey<'a>
[src]
impl<'a> From<&'a mut String> for SecretKey<'a>
impl<'a> From<String> for SecretKey<'a>
[src]
impl<'a> From<String> for SecretKey<'a>
impl<'a> From<&'a [u8]> for SecretKey<'a>
[src]
impl<'a> From<&'a [u8]> for SecretKey<'a>
impl<'a> From<&'a mut [u8]> for SecretKey<'a>
[src]
impl<'a> From<&'a mut [u8]> for SecretKey<'a>
impl<'a> From<&'a Vec<u8>> for SecretKey<'a>
[src]
impl<'a> From<&'a Vec<u8>> for SecretKey<'a>
impl<'a> From<&'a mut Vec<u8>> for SecretKey<'a>
[src]
impl<'a> From<&'a mut Vec<u8>> for SecretKey<'a>
impl<'a> From<Vec<u8>> for SecretKey<'a>
[src]
impl<'a> From<Vec<u8>> for SecretKey<'a>
impl<'a> From<&'a SecretKey<'a>> for SecretKey<'a>
[src]
impl<'a> From<&'a SecretKey<'a>> for SecretKey<'a>
impl<'a> From<&'a mut SecretKey<'a>> for SecretKey<'a>
[src]
impl<'a> From<&'a mut SecretKey<'a>> for SecretKey<'a>
impl<'a> Debug for SecretKey<'a>
[src]
impl<'a> Debug for SecretKey<'a>
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<'a> Eq for SecretKey<'a>
[src]
impl<'a> Eq for SecretKey<'a>
impl<'a> PartialEq for SecretKey<'a>
[src]
impl<'a> PartialEq for SecretKey<'a>
fn eq(&self, other: &SecretKey<'a>) -> bool
[src]
fn eq(&self, other: &SecretKey<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SecretKey<'a>) -> bool
[src]
fn ne(&self, other: &SecretKey<'a>) -> bool
This method tests for !=
.
impl<'a> Hash for SecretKey<'a>
[src]
impl<'a> Hash for SecretKey<'a>