Struct private_box::PublicKey [−][src]
PublicKey
for asymmetric authenticated encryption
Methods
impl PublicKey
[src]
impl PublicKey
pub fn from_slice(bs: &[u8]) -> Option<PublicKey>
[src]
pub fn from_slice(bs: &[u8]) -> Option<PublicKey>
from_slice()
creates an object from a byte slice
This function will fail and return None
if the length of
the byte-slice isn't equal to the length of the object
Trait Implementations
impl Index<Range<usize>> for PublicKey
[src]
impl Index<Range<usize>> for PublicKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[a..b] == y[a..b]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: Range<usize>) -> &[u8]
[src]
fn index(&self, _index: Range<usize>) -> &[u8]
Performs the indexing (container[index]
) operation.
impl Index<RangeFull> for PublicKey
[src]
impl Index<RangeFull> for PublicKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[] == y[]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &[u8]
[src]
fn index(&self, _index: RangeFull) -> &[u8]
Performs the indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for PublicKey
[src]
impl Index<RangeTo<usize>> for PublicKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[..b] == y[..b]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeTo<usize>) -> &[u8]
[src]
fn index(&self, _index: RangeTo<usize>) -> &[u8]
Performs the indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for PublicKey
[src]
impl Index<RangeFrom<usize>> for PublicKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[a..] == y[a..]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
[src]
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
Performs the indexing (container[index]
) operation.
impl<'de> Deserialize<'de> for PublicKey
[src]
impl<'de> Deserialize<'de> for PublicKey
fn deserialize<D>(
deserializer: D
) -> Result<PublicKey, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(
deserializer: D
) -> Result<PublicKey, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for PublicKey
[src]
impl Serialize for PublicKey
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl PartialOrd<PublicKey> for PublicKey
[src]
impl PartialOrd<PublicKey> for PublicKey
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &PublicKey) -> bool
[src]
fn lt(&self, other: &PublicKey) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &PublicKey) -> bool
[src]
fn le(&self, other: &PublicKey) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn ge(&self, other: &PublicKey) -> bool
[src]
fn ge(&self, other: &PublicKey) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
fn gt(&self, other: &PublicKey) -> bool
[src]
fn gt(&self, other: &PublicKey) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl Hash for PublicKey
[src]
impl Hash for PublicKey
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for PublicKey
[src]
impl Clone for PublicKey
fn clone(&self) -> PublicKey
[src]
fn clone(&self) -> PublicKey
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)
Performs copy-assignment from source
. Read more
impl Debug for PublicKey
[src]
impl Debug for PublicKey
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Copy for PublicKey
[src]
impl Copy for PublicKey
impl Ord for PublicKey
[src]
impl Ord for PublicKey
fn cmp(&self, other: &PublicKey) -> Ordering
[src]
fn cmp(&self, other: &PublicKey) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl AsRef<[u8]> for PublicKey
[src]
impl AsRef<[u8]> for PublicKey
impl Eq for PublicKey
[src]
impl Eq for PublicKey
impl PartialEq<PublicKey> for PublicKey
[src]
impl PartialEq<PublicKey> for PublicKey