#[repr(C)]pub struct PublicKey(pub [u8; 32]);
Expand description
The public half of a Keypair
.
Tuple Fields§
§0: [u8; 32]
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_slice(s: &[u8]) -> Option<PublicKey>
pub fn from_slice(s: &[u8]) -> Option<PublicKey>
Deserialize a public key from a byte slice. The slice length must be 32.
Sourcepub fn from_base64(s: &str) -> Option<PublicKey>
pub fn from_base64(s: &str) -> Option<PublicKey>
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();
Trait Implementations§
Source§impl Ord for PublicKey
impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
impl Copy for PublicKey
impl Eq for PublicKey
impl FromBytes for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more