Struct iop_keyvault::secp256k1::SecpPrivateKey
source · [−]pub struct SecpPrivateKey(_);
Expand description
Implementation of Secp256k1::PrivateKey
Implementations
sourceimpl SecpPrivateKey
impl SecpPrivateKey
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 private 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 from_ark_passphrase(phrase: impl AsRef<str>) -> Result<Self>
pub fn from_ark_passphrase(phrase: impl AsRef<str>) -> Result<Self>
Most ARK wallets simply hash a passphrase into a private key.
Trait Implementations
sourceimpl Add<&[u8]> for &SecpPrivateKey
impl Add<&[u8]> for &SecpPrivateKey
sourceimpl Clone for SecpPrivateKey
impl Clone for SecpPrivateKey
sourcefn clone(&self) -> SecpPrivateKey
fn clone(&self) -> SecpPrivateKey
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 From<SecpPrivateKey> for MPrivateKey
impl From<SecpPrivateKey> for MPrivateKey
sourcefn from(src: SecpPrivateKey) -> Self
fn from(src: SecpPrivateKey) -> Self
Converts to this type from the input type.
sourceimpl From<SecpPrivateKey> for SecretKey
impl From<SecpPrivateKey> for SecretKey
sourcefn from(sk: SecpPrivateKey) -> SecretKey
fn from(sk: SecpPrivateKey) -> SecretKey
Converts to this type from the input type.
sourceimpl From<SecretKey> for SecpPrivateKey
impl From<SecretKey> for SecpPrivateKey
sourceimpl PartialEq<SecpPrivateKey> for SecpPrivateKey
impl PartialEq<SecpPrivateKey> for SecpPrivateKey
sourcefn eq(&self, other: &SecpPrivateKey) -> bool
fn eq(&self, other: &SecpPrivateKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SecpPrivateKey) -> bool
fn ne(&self, other: &SecpPrivateKey) -> bool
This method tests for !=
.
sourceimpl PrivateKey<Secp256k1> for SecpPrivateKey
impl PrivateKey<Secp256k1> for SecpPrivateKey
sourcefn sign<D: AsRef<[u8]>>(&self, data: D) -> SecpSignature
fn sign<D: AsRef<[u8]>>(&self, data: D) -> SecpSignature
Panics
There is a 2^-256 chance this message cannot be signed by this key. The C implementation in bitcoin does not fail, but this pure rust version does. Then we panic.
sourcefn public_key(&self) -> SecpPublicKey
fn public_key(&self) -> SecpPublicKey
impl Eq for SecpPrivateKey
impl StructuralEq for SecpPrivateKey
impl StructuralPartialEq for SecpPrivateKey
Auto Trait Implementations
impl RefUnwindSafe for SecpPrivateKey
impl Send for SecpPrivateKey
impl Sync for SecpPrivateKey
impl Unpin for SecpPrivateKey
impl UnwindSafe for SecpPrivateKey
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