Enum casper_types::crypto::Signature
source · #[non_exhaustive]pub enum Signature {
System,
Ed25519(Signature),
Secp256k1(Signature),
}
Expand description
A signature of given data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
System
System signature. Cannot be verified.
Ed25519(Signature)
Ed25519 signature.
Secp256k1(Signature)
Secp256k1 signature.
Implementations§
source§impl Signature
impl Signature
sourcepub const SYSTEM_LENGTH: usize = 0usize
pub const SYSTEM_LENGTH: usize = 0usize
The length in bytes of a system signature,
sourcepub const ED25519_LENGTH: usize = 64usize
pub const ED25519_LENGTH: usize = 64usize
The length in bytes of an Ed25519 signature,
sourcepub const SECP256K1_LENGTH: usize = 64usize
pub const SECP256K1_LENGTH: usize = 64usize
The length in bytes of a secp256k1 signature
Trait Implementations§
source§impl AsymmetricType<'_> for Signature
impl AsymmetricType<'_> for Signature
source§fn ed25519_from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, Error>
fn ed25519_from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, Error>
Constructs a new ed25519 variant from a byte slice.
source§fn secp256k1_from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, Error>
fn secp256k1_from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, Error>
Constructs a new secp256k1 variant from a byte slice.
source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Signature
impl Ord for Signature
source§impl PartialOrd for Signature
impl PartialOrd for Signature
source§impl ToBytes for Signature
impl ToBytes for Signature
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Copy for Signature
impl Eq 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)