Struct iop_keyvault::secp256k1::SecpKeyId
source · [−]pub struct SecpKeyId(_);
Expand description
Implementation of Secp256k1::KeyId
Implementations
sourceimpl SecpKeyId
impl SecpKeyId
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 key id 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>
Creates a key id from a byte slice possibly returned by the to_bytes
method.
Error
If bytes
is not KEY_ID_SIZE
long
sourcepub fn to_p2pkh_addr(&self, prefix: &[u8; 1]) -> String
pub fn to_p2pkh_addr(&self, prefix: &[u8; 1]) -> String
Serializes the key identifier as a p2pkh
bitcoin address
Panics
If internal invariants of the key id format are not maintained because of a bug
sourcepub fn from_p2pkh_addr(
addr: &str,
network: &dyn Network<Suite = Secp256k1>
) -> Result<Self>
pub fn from_p2pkh_addr(
addr: &str,
network: &dyn Network<Suite = Secp256k1>
) -> Result<Self>
Deserializes the key identifier from a p2pkh
bitcoin address
sourcepub fn from_ark_pk(pk: &SecpPublicKey) -> Self
pub fn from_ark_pk(pk: &SecpPublicKey) -> Self
ARK uses a non-standard hashing of the compressed public key.
Trait Implementations
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 Ord for SecpKeyId
impl Ord for SecpKeyId
sourceimpl PartialOrd<SecpKeyId> for SecpKeyId
impl PartialOrd<SecpKeyId> for SecpKeyId
sourcefn partial_cmp(&self, other: &SecpKeyId) -> Option<Ordering>
fn partial_cmp(&self, other: &SecpKeyId) -> 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
impl Eq for SecpKeyId
impl StructuralEq for SecpKeyId
impl StructuralPartialEq for SecpKeyId
Auto Trait Implementations
impl RefUnwindSafe for SecpKeyId
impl Send for SecpKeyId
impl Sync for SecpKeyId
impl Unpin for SecpKeyId
impl UnwindSafe for SecpKeyId
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