Enum bc_components::SigningPrivateKey
source · pub enum SigningPrivateKey {
Schnorr(ECPrivateKey),
ECDSA(ECPrivateKey),
SSH(Box<PrivateKey>),
}Expand description
A private ECDSA, Schnorr or SSH key for signing.
- Both ECDSA and Schnorr keys are based on
ECPrivateKey. - SSH keys are based on
SSHPrivateKey, an alias for (ssh_key::PrivateKey).
Variants§
Implementations§
source§impl SigningPrivateKey
impl SigningPrivateKey
pub const fn new_schnorr(key: ECPrivateKey) -> Self
pub const fn new_ecdsa(key: ECPrivateKey) -> Self
pub fn new_ssh(key: SSHPrivateKey) -> Self
pub fn to_schnorr(&self) -> Option<&ECPrivateKey>
pub fn to_ecdsa(&self) -> Option<&ECPrivateKey>
pub fn to_ssh(&self) -> Option<&SSHPrivateKey>
pub fn public_key(&self) -> SigningPublicKey
Trait Implementations§
source§impl CBORTagged for SigningPrivateKey
impl CBORTagged for SigningPrivateKey
The CBOR tags assocated with this type. If more than one tag is present,
they are considered equivalent for reading, but only the first one is
used for writing.
source§impl CBORTaggedDecodable for SigningPrivateKey
impl CBORTaggedDecodable for SigningPrivateKey
source§fn from_untagged_cbor(untagged_cbor: CBOR) -> Result<Self>
fn from_untagged_cbor(untagged_cbor: CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for SigningPrivateKey
impl CBORTaggedEncodable for SigningPrivateKey
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 SigningPrivateKey
impl Clone for SigningPrivateKey
source§fn clone(&self) -> SigningPrivateKey
fn clone(&self) -> SigningPrivateKey
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 SigningPrivateKey
impl Debug for SigningPrivateKey
source§impl From<&SigningPrivateKey> for SigningPrivateKey
impl From<&SigningPrivateKey> for SigningPrivateKey
source§fn from(key: &SigningPrivateKey) -> Self
fn from(key: &SigningPrivateKey) -> Self
Converts to this type from the input type.
source§impl From<SigningPrivateKey> for CBOR
impl From<SigningPrivateKey> for CBOR
source§fn from(value: SigningPrivateKey) -> Self
fn from(value: SigningPrivateKey) -> Self
Converts to this type from the input type.
source§impl PartialEq for SigningPrivateKey
impl PartialEq for SigningPrivateKey
source§fn eq(&self, other: &SigningPrivateKey) -> bool
fn eq(&self, other: &SigningPrivateKey) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Signer for SigningPrivateKey
impl Signer for SigningPrivateKey
source§impl TryFrom<CBOR> for SigningPrivateKey
impl TryFrom<CBOR> for SigningPrivateKey
impl Eq for SigningPrivateKey
impl StructuralPartialEq for SigningPrivateKey
Auto Trait Implementations§
impl Freeze for SigningPrivateKey
impl RefUnwindSafe for SigningPrivateKey
impl Send for SigningPrivateKey
impl Sync for SigningPrivateKey
impl Unpin for SigningPrivateKey
impl UnwindSafe for SigningPrivateKey
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> CBOREncodable for T
impl<T> CBOREncodable for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)