pub struct PublicKey<KG: KeGroup>(_);
Expand description
Wrapper around a Key to enforce that it’s a public one.
Implementations
sourceimpl<KG: KeGroup> PublicKey<KG>
impl<KG: KeGroup> PublicKey<KG>
sourcepub fn deserialize(key_bytes: &[u8]) -> Result<Self, InternalError>
pub fn deserialize(key_bytes: &[u8]) -> Result<Self, InternalError>
Convert from bytes
sourcepub fn serialize(&self) -> GenericArray<u8, KG::PkLen>
pub fn serialize(&self) -> GenericArray<u8, KG::PkLen>
Convert to bytes
Trait Implementations
sourceimpl<'de, KG: KeGroup> Deserialize<'de> for PublicKey<KG>
impl<'de, KG: KeGroup> Deserialize<'de> for PublicKey<KG>
sourcefn 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
sourceimpl<KG: KeGroup> Ord for PublicKey<KG>where
KG::Pk: Ord,
impl<KG: KeGroup> Ord for PublicKey<KG>where
KG::Pk: Ord,
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<KG: KeGroup> PartialEq<PublicKey<KG>> for PublicKey<KG>where
KG::Pk: PartialEq,
impl<KG: KeGroup> PartialEq<PublicKey<KG>> for PublicKey<KG>where
KG::Pk: PartialEq,
sourceimpl<KG: KeGroup> PartialOrd<PublicKey<KG>> for PublicKey<KG>where
KG::Pk: PartialOrd,
impl<KG: KeGroup> PartialOrd<PublicKey<KG>> for PublicKey<KG>where
KG::Pk: PartialOrd,
sourcefn partial_cmp(&self, __other: &Self) -> Option<Ordering>
fn partial_cmp(&self, __other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<KG: KeGroup> Eq for PublicKey<KG>where
KG::Pk: Eq,
impl<KG: KeGroup> ZeroizeOnDrop for PublicKey<KG>
Auto Trait Implementations
impl<KG> RefUnwindSafe for PublicKey<KG>where
<KG as KeGroup>::Pk: RefUnwindSafe,
impl<KG> Send for PublicKey<KG>where
<KG as KeGroup>::Pk: Send,
impl<KG> Sync for PublicKey<KG>where
<KG as KeGroup>::Pk: Sync,
impl<KG> Unpin for PublicKey<KG>where
<KG as KeGroup>::Pk: Unpin,
impl<KG> UnwindSafe for PublicKey<KG>where
<KG as KeGroup>::Pk: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more