pub trait Signature: Clone + Sized {
type PublicKey: PublicKey;
const LENGTH: usize;
// Required methods
fn from_bytes(bytes: &[u8]) -> AptosResult<Self>;
fn to_bytes(&self) -> Vec<u8> ⓘ;
// Provided method
fn to_hex(&self) -> String { ... }
}Expand description
A trait for signature types.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn from_bytes(bytes: &[u8]) -> AptosResult<Self>
fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates a signature from bytes.
§Errors
Returns an error if the bytes have an invalid length or format.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl Signature for Bls12381Signature
Available on crate feature bls only.
impl Signature for Bls12381Signature
Available on crate feature
bls only.Source§impl Signature for Ed25519Signature
Available on crate feature ed25519 only.
impl Signature for Ed25519Signature
Available on crate feature
ed25519 only.Source§impl Signature for MultiEd25519Signature
Available on crate feature ed25519 only.
impl Signature for MultiEd25519Signature
Available on crate feature
ed25519 only.Source§impl Signature for Secp256k1Signature
Available on crate feature secp256k1 only.
impl Signature for Secp256k1Signature
Available on crate feature
secp256k1 only.