pub enum PublicKey {
Ed25519(PublicKey),
Bls(PublicKey),
BlsShare(PublicKeyShare),
}Expand description
Wrapper for different public key types.
Variants§
Implementations§
Source§impl PublicKey
impl PublicKey
Returns the BLS key share, if applicable.
Sourcepub fn verify<T: AsRef<[u8]>>(
&self,
signature: &Signature,
data: T,
) -> Result<()>
pub fn verify<T: AsRef<[u8]>>( &self, signature: &Signature, data: T, ) -> Result<()>
Returns Ok(()) if signature matches the message and Err(Error::InvalidSignature)
otherwise.
Sourcepub fn encode_to_zbase32(&self) -> String
pub fn encode_to_zbase32(&self) -> String
Returns the PublicKey serialised and encoded in z-base-32.
Sourcepub fn decode_from_zbase32<I: AsRef<str>>(encoded: I) -> Result<Self>
pub fn decode_from_zbase32<I: AsRef<str>>(encoded: I) -> Result<Self>
Creates from z-base-32 encoded string.
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§fn from(public_key: PublicKeyShare) -> Self
fn from(public_key: PublicKeyShare) -> Self
Converts to this type from the input type.
Source§impl Ord for PublicKey
impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
Source§impl TryFrom<QueryResponse> for PublicKey
impl TryFrom<QueryResponse> for PublicKey
Source§type Error = TryFromError
type Error = TryFromError
The type returned in the event of a conversion error.
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> 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 more