pub struct PublicKey(/* private fields */);
Available on crate feature
key
only.Expand description
A public key.
The key itself is just a 32 byte array, but a key has associated crypto information that is cached for performance reasons.
The cache item will be refreshed every time a crypto operation is performed, or when a key is deserialised or created from a byte array.
Serialisation or creation from a byte array is cheap if the key is already in the cache, but expensive if it is not.
Implementations§
Source§impl PublicKey
impl 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
impl FromStr for PublicKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)