pub struct Ed25519PublicKey { /* private fields */ }
Expand description
An ed25519 public key.
This key type is derived from Ed25519PrivateKey
and can be converted to a V3OnionServiceId
. It can also be used to verify a Ed25519Signature
.
Implementations§
Source§impl Ed25519PublicKey
A wrapper around tor_llcrypto::pk::ed25519::PublicKey
impl Ed25519PublicKey
A wrapper around tor_llcrypto::pk::ed25519::PublicKey
Sourcepub fn from_raw(raw: &[u8; 32]) -> Result<Ed25519PublicKey, Error>
pub fn from_raw(raw: &[u8; 32]) -> Result<Ed25519PublicKey, Error>
Construct an Ed25519PublicKey
from an array of bytes. Not all byte buffers of the required size can create a valid Ed25519PublicKey
. Only buffers derived from Ed25519PublicKey::as_bytes()
are required to convert correctly.
Sourcepub fn from_service_id(
service_id: &V3OnionServiceId,
) -> Result<Ed25519PublicKey, Error>
pub fn from_service_id( service_id: &V3OnionServiceId, ) -> Result<Ed25519PublicKey, Error>
Construct an Ed25519PublicKey
from a V3OnionServiceId
.
Sourcepub fn from_private_key(private_key: &Ed25519PrivateKey) -> Ed25519PublicKey
pub fn from_private_key(private_key: &Ed25519PrivateKey) -> Ed25519PublicKey
Construct an Ed25519PublicKey
from an Ed25519PrivateKey
.
Trait Implementations§
Source§impl Clone for Ed25519PublicKey
impl Clone for Ed25519PublicKey
Source§fn clone(&self) -> Ed25519PublicKey
fn clone(&self) -> Ed25519PublicKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Ed25519PublicKey
impl Debug for Ed25519PublicKey
Source§impl PartialEq for Ed25519PublicKey
impl PartialEq for Ed25519PublicKey
Auto Trait Implementations§
impl Freeze for Ed25519PublicKey
impl RefUnwindSafe for Ed25519PublicKey
impl Send for Ed25519PublicKey
impl Sync for Ed25519PublicKey
impl Unpin for Ed25519PublicKey
impl UnwindSafe for Ed25519PublicKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.