[−][src]Struct bls_dkg::member::signing::PublicKey
A public key.
Implementations
impl PublicKey
[src]
pub fn verify_g2<H>(&self, sig: &Signature, hash: H) -> bool where
H: Into<G2Affine>,
[src]
H: Into<G2Affine>,
Returns true
if the signature matches the element of G2
.
pub fn verify<M>(&self, sig: &Signature, msg: M) -> bool where
M: AsRef<[u8]>,
[src]
M: AsRef<[u8]>,
Returns true
if the signature matches the message.
This is equivalent to verify_g2(sig, hash_g2(msg))
.
pub fn encrypt<M>(&self, msg: M) -> Ciphertext where
M: AsRef<[u8]>,
[src]
M: AsRef<[u8]>,
Encrypts the message using the OS random number generator.
Uses the OsRng
by default. To pass in a custom random number generator, use
encrypt_with_rng()
.
pub fn encrypt_with_rng<R, M>(&self, rng: &mut R, msg: M) -> Ciphertext where
M: AsRef<[u8]>,
R: RngCore,
[src]
M: AsRef<[u8]>,
R: RngCore,
Encrypts the message.
pub fn from_bytes<B>(bytes: B) -> Result<PublicKey, FromBytesError> where
B: Borrow<[u8; 48]>,
[src]
B: Borrow<[u8; 48]>,
Returns the key with the given representation, if valid.
pub fn to_bytes(&self) -> [u8; 48]
[src]
Returns a byte string representation of the public key.
Trait Implementations
impl Clone for PublicKey
[src]
impl Copy for PublicKey
[src]
impl Debug for PublicKey
[src]
impl<'de> Deserialize<'de> for PublicKey
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<PublicKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Eq for PublicKey
[src]
impl Hash for PublicKey
[src]
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for PublicKey
[src]
pub fn cmp(&self, other: &PublicKey) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PublicKey> for PublicKey
[src]
impl PartialOrd<PublicKey> for PublicKey
[src]
pub fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for PublicKey
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for PublicKey
[src]
impl StructuralPartialEq for PublicKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,