Struct iop_keyvault::secp256k1::SecpPublicKey
source · [−]pub struct SecpPublicKey(_);
Expand description
Implementation of Secp256k1::PublicKey
Implementations
sourceimpl SecpPublicKey
impl SecpPublicKey
sourcepub fn to_bytes(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_bytes(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
The public key serialized in a format that can be fed to from_bytes
sourcepub fn from_bytes<D: AsRef<[u8]>>(bytes: D) -> Result<Self>
pub fn from_bytes<D: AsRef<[u8]>>(bytes: D) -> Result<Self>
sourcepub fn uncompressed(&self) -> [u8; 65]
pub fn uncompressed(&self) -> [u8; 65]
The public key serialized in the uncompressed format used in some places in the bitcoin
ecosystem (like address hashing in SecpKeyId::bitcoin_address
)
sourcepub fn ark_key_id(&self) -> SecpKeyId
pub fn ark_key_id(&self) -> SecpKeyId
ARK uses a non-standards hashing of the compressed public key.
sourcepub fn validate_ark_id(&self, key_id: &SecpKeyId) -> bool
pub fn validate_ark_id(&self, key_id: &SecpKeyId) -> bool
ARK uses a non-standards hashing of the compressed public key.
Trait Implementations
sourceimpl Add<&[u8]> for &SecpPublicKey
impl Add<&[u8]> for &SecpPublicKey
sourceimpl Clone for SecpPublicKey
impl Clone for SecpPublicKey
sourcefn clone(&self) -> SecpPublicKey
fn clone(&self) -> SecpPublicKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SecpPublicKey
impl Debug for SecpPublicKey
sourceimpl Display for SecpPublicKey
impl Display for SecpPublicKey
sourceimpl From<&SecpPublicKey> for SecpKeyId
impl From<&SecpPublicKey> for SecpKeyId
sourcefn from(pk: &SecpPublicKey) -> Self
fn from(pk: &SecpPublicKey) -> Self
Converts to this type from the input type.
sourceimpl From<PublicKey> for SecpPublicKey
impl From<PublicKey> for SecpPublicKey
sourceimpl From<SecpPublicKey> for MPublicKey
impl From<SecpPublicKey> for MPublicKey
sourcefn from(src: SecpPublicKey) -> Self
fn from(src: SecpPublicKey) -> Self
Converts to this type from the input type.
sourceimpl From<SecpPublicKey> for PublicKey
impl From<SecpPublicKey> for PublicKey
sourcefn from(pk: SecpPublicKey) -> PublicKey
fn from(pk: SecpPublicKey) -> PublicKey
Converts to this type from the input type.
sourceimpl FromStr for SecpPublicKey
impl FromStr for SecpPublicKey
sourceimpl Hash for SecpPublicKey
impl Hash for SecpPublicKey
sourceimpl Ord for SecpPublicKey
impl Ord for SecpPublicKey
sourceimpl PartialEq<SecpPublicKey> for SecpPublicKey
impl PartialEq<SecpPublicKey> for SecpPublicKey
sourcefn eq(&self, other: &SecpPublicKey) -> bool
fn eq(&self, other: &SecpPublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SecpPublicKey) -> bool
fn ne(&self, other: &SecpPublicKey) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SecpPublicKey> for SecpPublicKey
impl PartialOrd<SecpPublicKey> for SecpPublicKey
sourcefn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PublicKey<Secp256k1> for SecpPublicKey
impl PublicKey<Secp256k1> for SecpPublicKey
sourcefn key_id(&self) -> SecpKeyId
fn key_id(&self) -> SecpKeyId
Calculates the ID (also called fingerprint or address in some literature) of the public key. In some algorithms the public key is only revealed in point-to-point communications and a keypair is identified only by the digest of the public key in all other channels. Read more
sourcefn validate_id(&self, key_id: &SecpKeyId) -> bool
fn validate_id(&self, key_id: &SecpKeyId) -> bool
We do not have multiple versions of KeyIds for the same multicipher public key, so for now this comparison is trivial. But when we
introduce newer versions, we need to take the version of the key_id
argument into account and calculate that possibly older version
from self
. Read more
sourcefn verify<D: AsRef<[u8]>>(&self, data: D, sig: &SecpSignature) -> bool
fn verify<D: AsRef<[u8]>>(&self, data: D, sig: &SecpSignature) -> bool
This method can be used to verify if a given signature for a message was made using the private
key that belongs to this public key. See also PrivateKey::sign
Read more
impl Eq for SecpPublicKey
impl StructuralEq for SecpPublicKey
impl StructuralPartialEq for SecpPublicKey
Auto Trait Implementations
impl RefUnwindSafe for SecpPublicKey
impl Send for SecpPublicKey
impl Sync for SecpPublicKey
impl Unpin for SecpPublicKey
impl UnwindSafe for SecpPublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more