[−]Struct btcpay::SecretKey
Secret 256-bit key used as x
in an ECDSA signature
Methods
impl SecretKey
pub fn new<R>(rng: &mut R) -> SecretKey where
R: Rng + ?Sized,
R: Rng + ?Sized,
Creates a new random secret key. Requires compilation with the "rand" feature.
pub fn from_slice(data: &[u8]) -> Result<SecretKey, Error>
Converts a SECRET_KEY_SIZE
-byte slice to a secret key
pub fn add_assign(&mut self, other: &[u8]) -> Result<(), Error>
Adds one secret key to another, modulo the curve order. WIll return an error if the resulting key would be invalid or if the tweak was not a 32-byte length slice.
pub fn mul_assign(&mut self, other: &[u8]) -> Result<(), Error>
Multiplies one secret key by another, modulo the curve order. Will return an error if the resulting key would be invalid or if the tweak was not a 32-byte length slice.
impl SecretKey
pub fn as_ptr(&self) -> *const u8
Converts the object to a raw pointer for FFI interfacing
pub fn as_mut_ptr(&mut self) -> *mut u8
Converts the object to a mutable raw pointer for FFI interfacing
pub fn len(&self) -> usize
Returns the length of the object as an array
pub fn is_empty(&self) -> bool
Returns whether the object as an array is empty
Trait Implementations
impl CPtr for SecretKey
type Target = u8
fn as_c_ptr(&self) -> *const <SecretKey as CPtr>::Target
fn as_mut_c_ptr(&mut self) -> *mut <SecretKey as CPtr>::Target
impl Clone for SecretKey
fn clone(&self) -> SecretKey
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SecretKey
impl Debug for SecretKey
impl Display for SecretKey
impl Eq for SecretKey
impl From<SecretKey> for KeyPair
[src]
impl FromStr for SecretKey
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<SecretKey, Error>
impl Index<Range<usize>> for SecretKey
impl Index<RangeFrom<usize>> for SecretKey
type Output = [u8]
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &[u8]
impl Index<RangeFull> for SecretKey
impl Index<RangeTo<usize>> for SecretKey
impl Index<usize> for SecretKey
impl LowerHex for SecretKey
impl Ord for SecretKey
fn cmp(&self, other: &SecretKey) -> Ordering
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<SecretKey> for SecretKey
impl PartialOrd<SecretKey> for SecretKey
Auto Trait Implementations
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToHex for T where
T: LowerHex,
T: LowerHex,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,