Struct avalanche_types::key::bls::public_key::Key
source · pub struct Key(pub PublicKey);
Expand description
Represents “blst::min_pk::PublicKey”. By default, serializes as hex string.
Tuple Fields§
§0: PublicKey
Implementations§
source§impl Key
impl Key
sourcepub fn to_compressed_bytes(&self) -> [u8; 48]
pub fn to_compressed_bytes(&self) -> [u8; 48]
Converts the public key to compressed bytes. ref. “avalanchego/utils/crypto/bls.PublicKeyToBytes”
sourcepub fn from_bytes(compressed: &[u8]) -> Result<Self>
pub fn from_bytes(compressed: &[u8]) -> Result<Self>
Loads the public key from the compressed raw scalar bytes (in big endian).
sourcepub fn verify(&self, msg: &[u8], sig: &Sig) -> bool
pub fn verify(&self, msg: &[u8], sig: &Sig) -> bool
Verifies the message and the validity of its signature. Invariant: [self.0] and [sig] have both been validated. ref. “avalanchego/utils/crypto/bls.Verify”
sourcepub fn verify_proof_of_possession(&self, msg: &[u8], sig: &Sig) -> bool
pub fn verify_proof_of_possession(&self, msg: &[u8], sig: &Sig) -> bool
Verifies the message and the validity of its signature. Invariant: [self.0] and [sig] have both been validated. ref. “avalanchego/utils/crypto/bls.VerifyProofOfPossession”
Trait Implementations§
impl Copy for Key
impl Eq for Key
impl StructuralEq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request