pub struct PublicKey { /* private fields */ }
Expand description
A PublicKey
is used to verify signatures.
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn from_bytes(buf: &[u8]) -> Result<PublicKey>
pub fn from_bytes(buf: &[u8]) -> Result<PublicKey>
Deserialize a PublicKey
.
For storage, a PublicKeyBox
is usually what you need instead.
sourcepub fn from_secret_key(sk: &SecretKey) -> Result<PublicKey>
pub fn from_secret_key(sk: &SecretKey) -> Result<PublicKey>
Regenerate a PublicKey
from SecretKey
sourcepub fn to_bytes(&self) -> Vec<u8>
pub fn to_bytes(&self) -> Vec<u8>
Serialize a PublicKey
.
For storage, a PublicKeyBox
is usually what you want to use instead.
sourcepub fn from_box(pk_box: PublicKeyBox) -> Result<PublicKey>
pub fn from_box(pk_box: PublicKeyBox) -> Result<PublicKey>
Convert a PublicKeyBox
to a PublicKey
.
sourcepub fn to_box(&self) -> Result<PublicKeyBox>
pub fn to_box(&self) -> Result<PublicKeyBox>
Convert a PublicKey
to a PublicKeyBox
.
sourcepub fn from_base64(pk_string: &str) -> Result<PublicKey>
pub fn from_base64(pk_string: &str) -> Result<PublicKey>
Create a minimal public key from a base64-encoded string.
Trait Implementations§
source§impl From<PublicKeyBox> for PublicKey
impl From<PublicKeyBox> for PublicKey
source§fn from(pkb: PublicKeyBox) -> PublicKey
fn from(pkb: PublicKeyBox) -> PublicKey
Converts to this type from the input type.
source§impl PartialEq for PublicKey
impl PartialEq for PublicKey
impl Eq for PublicKey
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§
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