pub struct Bls12381PublicKey { /* private fields */ }bls only.Expand description
A BLS12-381 public key.
Implementations§
Source§impl Bls12381PublicKey
impl Bls12381PublicKey
Sourcepub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
pub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates a public key from compressed bytes (48 bytes).
§Errors
Returns an error if the bytes length is not 48 bytes or if the key deserialization fails.
Sourcepub fn from_hex(hex_str: &str) -> AptosResult<Self>
pub fn from_hex(hex_str: &str) -> AptosResult<Self>
Creates a public key from a hex string.
§Errors
Returns an error if hex decoding fails or if the resulting bytes are invalid.
Sourcepub fn verify(
&self,
message: &[u8],
signature: &Bls12381Signature,
) -> AptosResult<()>
pub fn verify( &self, message: &[u8], signature: &Bls12381Signature, ) -> AptosResult<()>
Source§impl Bls12381PublicKey
impl Bls12381PublicKey
Sourcepub fn aggregate(
public_keys: &[&Bls12381PublicKey],
) -> AptosResult<Bls12381PublicKey>
pub fn aggregate( public_keys: &[&Bls12381PublicKey], ) -> AptosResult<Bls12381PublicKey>
Aggregates multiple public keys into a single aggregated public key.
The aggregated public key can be used to verify an aggregated signature.
WARNING: This assumes all public keys have had their proofs-of-possession verified.
§Errors
Returns an error if the list of public keys is empty or if aggregation fails.
Trait Implementations§
Source§impl Clone for Bls12381PublicKey
impl Clone for Bls12381PublicKey
Source§fn clone(&self) -> Bls12381PublicKey
fn clone(&self) -> Bls12381PublicKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Bls12381PublicKey
impl Debug for Bls12381PublicKey
Source§impl<'de> Deserialize<'de> for Bls12381PublicKey
impl<'de> Deserialize<'de> for Bls12381PublicKey
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>,
Source§impl Display for Bls12381PublicKey
impl Display for Bls12381PublicKey
Source§impl PartialEq for Bls12381PublicKey
impl PartialEq for Bls12381PublicKey
Source§impl PublicKey for Bls12381PublicKey
impl PublicKey for Bls12381PublicKey
Source§fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates a public key from compressed bytes (48 bytes).
§Errors
Returns an error if the bytes length is not 48 bytes or if the key deserialization fails.
Source§impl Serialize for Bls12381PublicKey
impl Serialize for Bls12381PublicKey
Source§impl Verifier for Bls12381PublicKey
impl Verifier for Bls12381PublicKey
Source§fn verify(
&self,
message: &[u8],
signature: &Bls12381Signature,
) -> AptosResult<()>
fn verify( &self, message: &[u8], signature: &Bls12381Signature, ) -> AptosResult<()>
Source§type Signature = Bls12381Signature
type Signature = Bls12381Signature
impl Eq for Bls12381PublicKey
impl StructuralPartialEq for Bls12381PublicKey
Auto Trait Implementations§
impl Freeze for Bls12381PublicKey
impl RefUnwindSafe for Bls12381PublicKey
impl Send for Bls12381PublicKey
impl Sync for Bls12381PublicKey
impl Unpin for Bls12381PublicKey
impl UnsafeUnpin for Bls12381PublicKey
impl UnwindSafe for Bls12381PublicKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMoveArg for Twhere
T: Serialize,
impl<T> IntoMoveArg for Twhere
T: Serialize,
Source§fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.