pub enum SigningPrivateKey {
Schnorr(ECPrivateKey),
ECDSA(ECPrivateKey),
Ed25519(Ed25519PrivateKey),
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 const fn new_ed25519(key: Ed25519PrivateKey) -> Self
pub fn new_ssh(key: SSHPrivateKey) -> Self
pub fn to_schnorr(&self) -> Option<&ECPrivateKey>
pub fn is_schnorr(&self) -> bool
pub fn to_ecdsa(&self) -> Option<&ECPrivateKey>
pub fn is_ecdsa(&self) -> bool
pub fn to_ssh(&self) -> Option<&SSHPrivateKey>
pub fn is_ssh(&self) -> bool
pub fn public_key(&self) -> SigningPublicKey
Source§impl SigningPrivateKey
impl SigningPrivateKey
pub fn schnorr_sign( &self, message: impl AsRef<[u8]>, rng: Rc<RefCell<dyn RandomNumberGenerator>>, ) -> Result<Signature>
pub fn ed25519_sign(&self, message: impl AsRef<[u8]>) -> Result<Signature>
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 XID
impl From<&SigningPrivateKey> for XID
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§impl Signer for SigningPrivateKey
impl Signer for SigningPrivateKey
Source§impl TryFrom<CBOR> for SigningPrivateKey
impl TryFrom<CBOR> for SigningPrivateKey
Source§impl Verifier for SigningPrivateKey
impl Verifier 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