pub enum UserSignature {
Simple(SimpleSignature),
Multisig(MultisigAggregatedSignature),
ZkLogin(Box<ZkLoginAuthenticator>),
Passkey(PasskeyAuthenticator),
}
Expand description
A signature from a user
A UserSignature
is most commonly used to authorize the execution and inclusion of a
transaction to the blockchain.
§BCS
The BCS serialized form for this type is defined by the following ABNF:
user-signature-bcs = bytes ; where the contents of the bytes are defined by <user-signature>
user-signature = simple-signature / multisig / multisig-legacy / zklogin / passkey
Note: Due to historical reasons, signatures are serialized slightly different from the majority
of the types in Sui. In particular if a signature is ever embedded in another structure it
generally is serialized as bytes
meaning it has a length prefix that defines the length of
the completely serialized signature.
Variants§
Simple(SimpleSignature)
Multisig(MultisigAggregatedSignature)
ZkLogin(Box<ZkLoginAuthenticator>)
Passkey(PasskeyAuthenticator)
Implementations§
Source§impl UserSignature
impl UserSignature
pub fn to_bytes(&self) -> Vec<u8>
Available on crate feature
serde
only.pub fn to_base64(&self) -> String
Available on crate feature
serde
only.pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Available on crate feature
serde
only.pub fn from_base64(s: &str) -> Result<Self, Error>
Available on crate feature
serde
only.Source§impl UserSignature
impl UserSignature
Sourcepub fn scheme(&self) -> SignatureScheme
pub fn scheme(&self) -> SignatureScheme
Return the flag for this signature scheme
Trait Implementations§
Source§impl Arbitrary for UserSignature
impl Arbitrary for UserSignature
Source§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.Source§type Strategy = BoxedStrategy<UserSignature>
type Strategy = BoxedStrategy<UserSignature>
The type of
Strategy
used to generate values of type Self
.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl Clone for UserSignature
impl Clone for UserSignature
Source§fn clone(&self) -> UserSignature
fn clone(&self) -> UserSignature
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 UserSignature
impl Debug for UserSignature
Source§impl<'de> Deserialize<'de> for UserSignature
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for UserSignature
Available on crate feature
serde
only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UserSignature
impl PartialEq for UserSignature
Source§impl Serialize for UserSignature
Available on crate feature serde
only.
impl Serialize for UserSignature
Available on crate feature
serde
only.impl Eq for UserSignature
impl StructuralPartialEq for UserSignature
Auto Trait Implementations§
impl Freeze for UserSignature
impl RefUnwindSafe for UserSignature
impl Send for UserSignature
impl Sync for UserSignature
impl Unpin for UserSignature
impl UnwindSafe for UserSignature
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moreSource§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