Struct ssb_crypto::PublicKey [−][src]
Expand description
The public half of a Keypair
.
Tuple Fields
0: [u8; 32]
Implementations
Deserialize a public key from a byte slice. The slice length must be 32.
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();
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);
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self