pub struct PublicKey(/* private fields */);
Available on crate feature
key
only.Expand description
A public key.
The key itself is stored as the CompressedEdwards
y coordinate of the public key
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn public(&self) -> VerifyingKey
pub fn public(&self) -> VerifyingKey
Returns the VerifyingKey
for this PublicKey
.
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, SignatureError>
pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, SignatureError>
Construct a PublicKey
from a slice of bytes.
§Warning
This will return a SignatureError
if the bytes passed into this method do not represent
a valid ed25519_dalek
curve point. Will never fail for bytes return from Self::as_bytes
.
See VerifyingKey::from_bytes
for details.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<VerifyingKey> for PublicKey
impl From<VerifyingKey> for PublicKey
Source§fn from(verifying_key: VerifyingKey) -> Self
fn from(verifying_key: VerifyingKey) -> Self
Converts to this type from the input type.
Source§impl FromStr for PublicKey
Deserialises the PublicKey
from it’s base32 encoding.
impl FromStr for PublicKey
Deserialises the PublicKey
from it’s base32 encoding.
Display
is capable of serialising this format.
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 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