[−][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 as_base64(&self) -> String[src]
Does not include ".ed25519" suffix or a prefix sigil.
Example
let s = "H2qXeS5sOKUqaGNFgRJ6qR48+lAeP0C9lq9IVlQMotc="; let pk = ssb_crypto::PublicKey::from_base64(s).unwrap(); assert_eq!(pk.as_base64(), s);
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]
pub fn only_derive_is_allowed_to_implement_this_trait() where
Self: Sized, [src]
Self: Sized,
pub fn as_bytes(&self) -> &[u8][src]
pub 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]
pub fn only_derive_is_allowed_to_implement_this_trait() where
Self: Sized, [src]
Self: Sized,
impl Hash for PublicKey[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for PublicKey[src]
pub fn cmp(&self, other: &PublicKey) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl PartialEq<PublicKey> for PublicKey[src]
impl PartialOrd<PublicKey> for PublicKey[src]
pub fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>[src]
pub fn lt(&self, other: &PublicKey) -> bool[src]
pub fn le(&self, other: &PublicKey) -> bool[src]
pub fn gt(&self, other: &PublicKey) -> bool[src]
pub fn ge(&self, other: &PublicKey) -> bool[src]
impl StructuralEq for PublicKey[src]
impl StructuralPartialEq for PublicKey[src]
Auto Trait Implementations
impl RefUnwindSafe for PublicKey[src]
impl Send for PublicKey[src]
impl Sync for PublicKey[src]
impl Unpin for PublicKey[src]
impl UnwindSafe for PublicKey[src]
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,
pub 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.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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.
pub 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>,