pub struct AuthenticationKey(/* private fields */);Expand description
An authentication key used to verify account ownership.
The authentication key is derived from the public key and can be rotated to support key rotation.
Implementations§
Source§impl AuthenticationKey
impl AuthenticationKey
Sourcepub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
pub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates an authentication key from a byte slice.
§Errors
Returns an error if the byte slice length is not exactly 32 bytes.
Sourcepub fn from_hex(hex_str: &str) -> AptosResult<Self>
pub fn from_hex(hex_str: &str) -> AptosResult<Self>
Creates an authentication key from a hex string.
§Errors
This function will return an error if:
- The hex string is invalid or cannot be decoded
- The decoded bytes are not exactly 32 bytes long
Sourcepub fn to_address(&self) -> AccountAddress
pub fn to_address(&self) -> AccountAddress
Derives the account address from this authentication key.
For most accounts, the address equals the authentication key.
Trait Implementations§
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 · 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 From<AuthenticationKey> for [u8; 32]
impl From<AuthenticationKey> for [u8; 32]
Source§fn from(key: AuthenticationKey) -> Self
fn from(key: AuthenticationKey) -> Self
Converts to this type from the input type.
Source§impl From<AuthenticationKey> for AccountAddress
impl From<AuthenticationKey> for AccountAddress
Source§fn from(key: AuthenticationKey) -> Self
fn from(key: AuthenticationKey) -> Self
Converts to this type from the input type.
Source§impl Hash for AuthenticationKey
impl Hash for AuthenticationKey
Source§impl PartialEq for AuthenticationKey
impl PartialEq for AuthenticationKey
Source§impl Serialize for AuthenticationKey
impl Serialize for AuthenticationKey
impl Copy for AuthenticationKey
impl Eq for AuthenticationKey
impl StructuralPartialEq for AuthenticationKey
Auto Trait Implementations§
impl Freeze for AuthenticationKey
impl RefUnwindSafe for AuthenticationKey
impl Send for AuthenticationKey
impl Sync for AuthenticationKey
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMoveArg for Twhere
T: Serialize,
impl<T> IntoMoveArg for Twhere
T: Serialize,
Source§fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
Converts this value into BCS-encoded bytes. Read more
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.