pub enum AccountAuthenticator {
Ed25519 {
public_key: Validatable<Ed25519PublicKey>,
signature: Ed25519Signature,
},
MultiEd25519 {
public_key: MultiEd25519PublicKey,
signature: MultiEd25519Signature,
},
}
Variants§
Implementations§
source§impl AccountAuthenticator
impl AccountAuthenticator
sourcepub fn ed25519(public_key: Ed25519PublicKey, signature: Ed25519Signature) -> Self
pub fn ed25519(public_key: Ed25519PublicKey, signature: Ed25519Signature) -> Self
Create a single-signature ed25519 authenticator
sourcepub fn multi_ed25519(
public_key: MultiEd25519PublicKey,
signature: MultiEd25519Signature
) -> Self
pub fn multi_ed25519( public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature ) -> Self
Create a multisignature ed25519 authenticator
sourcepub fn verify<T: Serialize + CryptoHash>(&self, message: &T) -> Result<()>
pub fn verify<T: Serialize + CryptoHash>(&self, message: &T) -> Result<()>
Return Ok if the authenticator’s public key matches its signature, Err otherwise
sourcepub fn public_key_bytes(&self) -> Vec<u8> ⓘ
pub fn public_key_bytes(&self) -> Vec<u8> ⓘ
Return the raw bytes of self.public_key
sourcepub fn signature_bytes(&self) -> Vec<u8> ⓘ
pub fn signature_bytes(&self) -> Vec<u8> ⓘ
Return the raw bytes of self.signature
sourcepub fn authentication_key_preimage(&self) -> AuthenticationKeyPreimage
pub fn authentication_key_preimage(&self) -> AuthenticationKeyPreimage
Return an authentication key preimage derived from self
’s public key and scheme id
sourcepub fn authentication_key(&self) -> AuthenticationKey
pub fn authentication_key(&self) -> AuthenticationKey
Return an authentication key derived from self
’s public key and scheme id
sourcepub fn number_of_signatures(&self) -> usize
pub fn number_of_signatures(&self) -> usize
Return the number of signatures included in this account authenticator.
Trait Implementations§
source§impl Clone for AccountAuthenticator
impl Clone for AccountAuthenticator
source§fn clone(&self) -> AccountAuthenticator
fn clone(&self) -> AccountAuthenticator
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 AccountAuthenticator
impl Debug for AccountAuthenticator
source§impl<'de> Deserialize<'de> for AccountAuthenticator
impl<'de> Deserialize<'de> for AccountAuthenticator
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 Display for AccountAuthenticator
impl Display for AccountAuthenticator
source§impl Hash for AccountAuthenticator
impl Hash for AccountAuthenticator
source§impl PartialEq<AccountAuthenticator> for AccountAuthenticator
impl PartialEq<AccountAuthenticator> for AccountAuthenticator
source§fn eq(&self, other: &AccountAuthenticator) -> bool
fn eq(&self, other: &AccountAuthenticator) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for AccountAuthenticator
impl Serialize for AccountAuthenticator
impl Eq for AccountAuthenticator
impl StructuralEq for AccountAuthenticator
impl StructuralPartialEq for AccountAuthenticator
Auto Trait Implementations§
impl RefUnwindSafe for AccountAuthenticator
impl Send for AccountAuthenticator
impl Sync for AccountAuthenticator
impl Unpin for AccountAuthenticator
impl UnwindSafe for AccountAuthenticator
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.