Struct diem_types::transaction::authenticator::AuthenticationKey
source · pub struct AuthenticationKey(_);
Expand description
A struct that represents an account authentication key. An account’s address is the last 16 bytes of authentication key used to create it
Implementations§
source§impl AuthenticationKey
impl AuthenticationKey
sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Return an authentication key that is impossible (in expectation) to sign for–useful for intentionally relinquishing control of an account.
sourcepub fn from_preimage(preimage: &AuthenticationKeyPreimage) -> AuthenticationKey
pub fn from_preimage(preimage: &AuthenticationKeyPreimage) -> AuthenticationKey
Create an authentication key from a preimage by taking its sha3 hash
sourcepub fn ed25519(public_key: &Ed25519PublicKey) -> AuthenticationKey
pub fn ed25519(public_key: &Ed25519PublicKey) -> AuthenticationKey
Create an authentication key from an Ed25519 public key
sourcepub fn multi_ed25519(public_key: &MultiEd25519PublicKey) -> Self
pub fn multi_ed25519(public_key: &MultiEd25519PublicKey) -> Self
Create an authentication key from a MultiEd25519 public key
sourcepub fn derived_address(&self) -> AccountAddress
pub fn derived_address(&self) -> AccountAddress
Return an address derived from the last AccountAddress::LENGTH
bytes of this
authentication key.
Trait Implementations§
source§impl Arbitrary for AuthenticationKey
impl Arbitrary for AuthenticationKey
§type Parameters = <[u8; 32] as Arbitrary>::Parameters
type Parameters = <[u8; 32] as Arbitrary>::Parameters
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<[u8; 32] as Arbitrary>::Strategy, fn(_: [u8; 32]) -> AuthenticationKey>
type Strategy = Map<<[u8; 32] as Arbitrary>::Strategy, fn(_: [u8; 32]) -> AuthenticationKey>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl AsRef<[u8]> for AuthenticationKey
impl AsRef<[u8]> for AuthenticationKey
source§impl Clone for AuthenticationKey
impl Clone for AuthenticationKey
source§fn clone(&self) -> AuthenticationKey
fn clone(&self) -> AuthenticationKey
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 AuthenticationKey
impl Debug for AuthenticationKey
source§impl<'de> Deserialize<'de> for AuthenticationKey
impl<'de> Deserialize<'de> for AuthenticationKey
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 AuthenticationKey
impl Display for AuthenticationKey
source§impl FromStr for AuthenticationKey
impl FromStr for AuthenticationKey
source§impl Hash for AuthenticationKey
impl Hash for AuthenticationKey
source§impl LowerHex for AuthenticationKey
impl LowerHex for AuthenticationKey
source§impl Ord for AuthenticationKey
impl Ord for AuthenticationKey
source§fn cmp(&self, other: &AuthenticationKey) -> Ordering
fn cmp(&self, other: &AuthenticationKey) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AuthenticationKey> for AuthenticationKey
impl PartialEq<AuthenticationKey> for AuthenticationKey
source§fn eq(&self, other: &AuthenticationKey) -> bool
fn eq(&self, other: &AuthenticationKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AuthenticationKey> for AuthenticationKey
impl PartialOrd<AuthenticationKey> for AuthenticationKey
source§fn partial_cmp(&self, other: &AuthenticationKey) -> Option<Ordering>
fn partial_cmp(&self, other: &AuthenticationKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for AuthenticationKey
impl Serialize for AuthenticationKey
source§impl TryFrom<&[u8]> for AuthenticationKey
impl TryFrom<&[u8]> for AuthenticationKey
§type Error = CryptoMaterialError
type Error = CryptoMaterialError
The type returned in the event of a conversion error.
source§fn try_from(bytes: &[u8]) -> Result<AuthenticationKey, CryptoMaterialError>
fn try_from(bytes: &[u8]) -> Result<AuthenticationKey, CryptoMaterialError>
Performs the conversion.
source§impl TryFrom<Vec<u8, Global>> for AuthenticationKey
impl TryFrom<Vec<u8, Global>> for AuthenticationKey
§type Error = CryptoMaterialError
type Error = CryptoMaterialError
The type returned in the event of a conversion error.
source§fn try_from(bytes: Vec<u8>) -> Result<AuthenticationKey, CryptoMaterialError>
fn try_from(bytes: Vec<u8>) -> Result<AuthenticationKey, CryptoMaterialError>
Performs the conversion.
impl Copy for AuthenticationKey
impl Eq for AuthenticationKey
impl StructuralEq for AuthenticationKey
impl StructuralPartialEq for AuthenticationKey
Auto Trait Implementations§
impl RefUnwindSafe for AuthenticationKey
impl Send for AuthenticationKey
impl Sync for AuthenticationKey
impl Unpin for AuthenticationKey
impl UnwindSafe for AuthenticationKey
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.
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)source§impl<T> ValidCryptoMaterialStringExt for Twhere
T: ValidCryptoMaterial,
impl<T> ValidCryptoMaterialStringExt for Twhere T: ValidCryptoMaterial,
source§fn from_encoded_string(encoded_str: &str) -> Result<Self, CryptoMaterialError>
fn from_encoded_string(encoded_str: &str) -> Result<Self, CryptoMaterialError>
When trying to convert from bytes, we simply decode the string into
bytes before checking if we can convert.