pub struct AuthenticationKey(/* private fields */);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 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 duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AuthenticationKey
Source§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
impl Eq 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 (const: unstable) · 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 for AuthenticationKey
impl PartialEq for AuthenticationKey
Source§impl PartialOrd for AuthenticationKey
impl PartialOrd for AuthenticationKey
Source§impl Serialize for AuthenticationKey
impl Serialize for AuthenticationKey
impl StructuralPartialEq for AuthenticationKey
Source§impl TryFrom<&[u8]> for AuthenticationKey
impl TryFrom<&[u8]> for AuthenticationKey
Source§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>> for AuthenticationKey
impl TryFrom<Vec<u8>> for AuthenticationKey
Source§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.
Auto Trait Implementations§
impl Freeze for AuthenticationKey
impl RefUnwindSafe for AuthenticationKey
impl Send for AuthenticationKey
impl Sync for AuthenticationKey
impl Unpin for AuthenticationKey
impl UnsafeUnpin for AuthenticationKey
impl UnwindSafe for AuthenticationKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> TestOnlyHash for T
impl<T> TestOnlyHash for T
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 T
impl<T> ToHex for T
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.