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 / passkeyNote: Due to historical reasons, signatures are serialized slightly
different from the majority of the types in IOTA. 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
pub fn is_simple(&self) -> bool
pub fn as_simple(&self) -> &SimpleSignature
pub fn as_simple_opt(&self) -> Option<&SimpleSignature>
pub fn into_simple_opt(self) -> Option<SimpleSignature>
pub fn into_simple(self) -> SimpleSignature
pub fn is_multisig(&self) -> bool
pub fn as_multisig(&self) -> &MultisigAggregatedSignature
pub fn as_multisig_opt(&self) -> Option<&MultisigAggregatedSignature>
pub fn into_multisig_opt(self) -> Option<MultisigAggregatedSignature>
pub fn into_multisig(self) -> MultisigAggregatedSignature
pub fn is_passkey(&self) -> bool
pub fn as_passkey(&self) -> &PasskeyAuthenticator
pub fn as_passkey_opt(&self) -> Option<&PasskeyAuthenticator>
pub fn into_passkey_opt(self) -> Option<PasskeyAuthenticator>
pub fn into_passkey(self) -> PasskeyAuthenticator
pub fn is_zklogin(&self) -> bool
pub fn as_zklogin_opt(&self) -> Option<&ZkLoginAuthenticator>
pub fn as_zklogin(&self) -> &ZkLoginAuthenticator
pub fn into_zklogin_opt(self) -> Option<ZkLoginAuthenticator>
pub fn into_zklogin(self) -> ZkLoginAuthenticator
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 duplicate 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 JsonSchema for UserSignature
Available on crate feature serde only.
impl JsonSchema for UserSignature
Available on crate feature
serde only.Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§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§
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more