Struct bc_components::ECPrivateKey
source · pub struct ECPrivateKey(_);
Expand description
An elliptic curve digital signature algorithm (ECDSA) private key.
Implementations§
source§impl ECPrivateKey
impl ECPrivateKey
sourcepub fn new_using(rng: &mut impl RandomNumberGenerator) -> Self
pub fn new_using(rng: &mut impl RandomNumberGenerator) -> Self
Creates a new random ECDSA private key using the given random number generator.
source§impl ECPrivateKey
impl ECPrivateKey
sourcepub fn schnorr_public_key(&self) -> SchnorrPublicKey
pub fn schnorr_public_key(&self) -> SchnorrPublicKey
Derives the Schnorr public key from this ECDSA private key.
sourcepub fn ecdsa_sign<T>(&self, message: T) -> [u8; 64]where
T: AsRef<[u8]>,
pub fn ecdsa_sign<T>(&self, message: T) -> [u8; 64]where T: AsRef<[u8]>,
ECDSA signs the given message using this ECDSA private key.
sourcepub fn schnorr_sign_using<D1, D2>(
&self,
message: D1,
tag: D2,
rng: &mut impl RandomNumberGenerator
) -> [u8; 64]where
D1: AsRef<[u8]>,
D2: AsRef<[u8]>,
pub fn schnorr_sign_using<D1, D2>( &self, message: D1, tag: D2, rng: &mut impl RandomNumberGenerator ) -> [u8; 64]where D1: AsRef<[u8]>, D2: AsRef<[u8]>,
Schnorr signs the given message using this ECDSA private key, the given tag, and the given random number generator.
Trait Implementations§
source§impl AsRef<[u8]> for ECPrivateKey
impl AsRef<[u8]> for ECPrivateKey
source§impl CBOREncodable for ECPrivateKey
impl CBOREncodable for ECPrivateKey
source§impl CBORTagged for ECPrivateKey
impl CBORTagged for ECPrivateKey
source§impl CBORTaggedEncodable for ECPrivateKey
impl CBORTaggedEncodable for ECPrivateKey
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§impl Clone for ECPrivateKey
impl Clone for ECPrivateKey
source§fn clone(&self) -> ECPrivateKey
fn clone(&self) -> ECPrivateKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ECPrivateKey
impl Debug for ECPrivateKey
source§impl Default for ECPrivateKey
impl Default for ECPrivateKey
source§impl Display for ECPrivateKey
impl Display for ECPrivateKey
source§impl ECKey for ECPrivateKey
impl ECKey for ECPrivateKey
fn public_key(&self) -> ECPublicKey
source§impl ECKeyBase for ECPrivateKey
impl ECKeyBase for ECPrivateKey
source§impl<'a> From<&'a ECPrivateKey> for &'a [u8]
impl<'a> From<&'a ECPrivateKey> for &'a [u8]
source§fn from(value: &'a ECPrivateKey) -> Self
fn from(value: &'a ECPrivateKey) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a ECPrivateKey> for &'a [u8; 32]
impl<'a> From<&'a ECPrivateKey> for &'a [u8; 32]
source§fn from(value: &'a ECPrivateKey) -> Self
fn from(value: &'a ECPrivateKey) -> Self
Converts to this type from the input type.
source§impl Hash for ECPrivateKey
impl Hash for ECPrivateKey
source§impl PartialEq<ECPrivateKey> for ECPrivateKey
impl PartialEq<ECPrivateKey> for ECPrivateKey
source§fn eq(&self, other: &ECPrivateKey) -> bool
fn eq(&self, other: &ECPrivateKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl UREncodable for ECPrivateKey
impl UREncodable for ECPrivateKey
impl Eq for ECPrivateKey
impl StructuralEq for ECPrivateKey
impl StructuralPartialEq for ECPrivateKey
Auto Trait Implementations§
impl RefUnwindSafe for ECPrivateKey
impl Send for ECPrivateKey
impl Sync for ECPrivateKey
impl Unpin for ECPrivateKey
impl UnwindSafe for ECPrivateKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)