pub enum Signature {
Schnorr([u8; 64]),
ECDSA([u8; 64]),
Ed25519([u8; 64]),
SSH(SshSig),
}Expand description
A cryptographic signature. Supports ECDSA and Schnorr.
Variants§
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn schnorr_from_data(data: [u8; 64]) -> Self
pub fn schnorr_from_data(data: [u8; 64]) -> Self
Restores a Schnorr signature from an array of bytes.
Sourcepub fn schnorr_from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
pub fn schnorr_from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
Restores a Schnorr signature from an array of bytes.
Sourcepub fn ecdsa_from_data(data: [u8; 64]) -> Self
pub fn ecdsa_from_data(data: [u8; 64]) -> Self
Restores an ECDSA signature from an array of bytes.
Sourcepub fn ecdsa_from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
pub fn ecdsa_from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
Restores an ECDSA signature from an array of bytes.
pub fn ed25519_from_data(data: [u8; 64]) -> Self
pub fn ed25519_from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
pub fn to_schnorr(&self) -> Option<&[u8; 64]>
pub fn to_ecdsa(&self) -> Option<&[u8; 64]>
pub fn to_ssh(&self) -> Option<&SshSig>
Trait Implementations§
Source§impl CBORTagged for Signature
impl CBORTagged for Signature
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 Signature
impl CBORTaggedDecodable for Signature
Source§fn from_untagged_cbor(cbor: CBOR) -> Result<Self>
fn from_untagged_cbor(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 Signature
impl CBORTaggedEncodable for Signature
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.
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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