[−][src]Struct ssb_crypto::PublicKey
The public half of a Keypair.
Implementations
impl PublicKey[src]
pub const SIZE: usize[src]
Size of a public key, in bytes (== 32).
pub fn from_slice(s: &[u8]) -> Option<Self>[src]
Deserialize a public key from a byte slice. The slice length must be 32.
pub fn from_base64(s: &str) -> Option<Self>[src]
Deserialize from the base-64 representation. Ignores optional leading '@' sigil and '.ed25519' suffix.
Example
use ssb_crypto::PublicKey; let author = "@H2qXeS5sOKUqaGNFgRJ6qR48+lAeP0C9lq9IVlQMotc=.ed25519"; let pk = PublicKey::from_base64(author).unwrap();
pub fn verify(&self, sig: &Signature, b: &[u8]) -> bool[src]
Verify that a signature was generated by this key's secret half for the given bytes.
Trait Implementations
impl AsBytes for PublicKey[src]
fn only_derive_is_allowed_to_implement_this_trait() where
Self: Sized, [src]
Self: Sized,
fn as_bytes(&self) -> &[u8][src]
fn as_bytes_mut(&mut self) -> &mut [u8] where
Self: FromBytes, [src]
Self: FromBytes,
impl Clone for PublicKey[src]
impl Copy for PublicKey[src]
impl Debug for PublicKey[src]
impl Eq for PublicKey[src]
impl FromBytes for PublicKey[src]
fn only_derive_is_allowed_to_implement_this_trait() where
Self: Sized, [src]
Self: Sized,
impl Hash for PublicKey[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for PublicKey[src]
fn cmp(&self, other: &PublicKey) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<PublicKey> for PublicKey[src]
impl PartialOrd<PublicKey> for PublicKey[src]
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>[src]
fn lt(&self, other: &PublicKey) -> bool[src]
fn le(&self, other: &PublicKey) -> bool[src]
fn gt(&self, other: &PublicKey) -> bool[src]
fn ge(&self, other: &PublicKey) -> bool[src]
impl StructuralEq for PublicKey[src]
impl StructuralPartialEq for PublicKey[src]
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,