pub struct PublicKey { /* private fields */ }Available on crate feature
eddsa only.Expand description
PublicKey contains an Ed25519 public key usable for verification.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bytes(bin: &[u8; 32]) -> Result<Self, Box<dyn Error>>
pub fn from_bytes(bin: &[u8; 32]) -> Result<Self, Box<dyn Error>>
from_bytes converts a 32-byte array into a public key.
Sourcepub fn from_der(der: &[u8]) -> Result<Self, Box<dyn Error>>
pub fn from_der(der: &[u8]) -> Result<Self, Box<dyn Error>>
from_der parses a DER buffer into a public key.
Sourcepub fn from_pem(pem_str: &str) -> Result<Self, Box<dyn Error>>
pub fn from_pem(pem_str: &str) -> Result<Self, Box<dyn Error>>
from_pem parses a PEM string into a public key.
Sourcepub fn fingerprint(&self) -> Fingerprint
pub fn fingerprint(&self) -> Fingerprint
fingerprint returns a 256bit unique identified for this key. For Ed25519, that is the SHA256 hash of the raw public key.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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