pub struct UnlockedCredentials { /* private fields */ }Expand description
Unlocked keys and their Account locator, owned by the caller.
No Debug/Serialize/Clone implementation is provided. Returned signer clones and handles have independent lifetimes; dropping this owner is not revocation or a promise to erase parser, allocator or cryptographic-library copies.
Implementations§
Source§impl UnlockedCredentials
impl UnlockedCredentials
Sourcepub fn account_id(&self) -> &ID
pub fn account_id(&self) -> &ID
The authenticated Account locator. It grants no access by itself.
Sourcepub fn key_ids(&self) -> Vec<PublicKey>
pub fn key_ids(&self) -> Vec<PublicKey>
Public IDs of exactly the explicitly supplied keys, in supplied order.
Sourcepub fn signer(&self, key_id: &PublicKey) -> Result<PrivateKey>
pub fn signer(&self, key_id: &PublicKey) -> Result<PrivateKey>
Obtain an independently owned signer for an explicit key selection. A missing key is an error, never fallback to a personal/default key.
Sourcepub fn add_key(&mut self, key: PrivateKey) -> Result<()>
pub fn add_key(&mut self, key: PrivateKey) -> Result<()>
Add an explicitly supplied key locally. Neither references nor Auth
changes call this method automatically. Persist with Self::seal.
Sourcepub fn seal(&self) -> Result<CredentialBundle>
pub fn seal(&self) -> Result<CredentialBundle>
Encrypt the current explicit bundle using the unlocked wrapping key and a fresh nonce. Does not persist or change the password.
Sourcepub fn rewrap(&self, password: &str) -> Result<CredentialBundle>
pub fn rewrap(&self, password: &str) -> Result<CredentialBundle>
Rewrap with a new password and salt. Does not revoke or rotate signing keys, invalidate existing handles or render old copies unrecoverable. The caller must explicitly persist the result before discarding it.
Auto Trait Implementations§
impl Freeze for UnlockedCredentials
impl RefUnwindSafe for UnlockedCredentials
impl Send for UnlockedCredentials
impl Sync for UnlockedCredentials
impl Unpin for UnlockedCredentials
impl UnsafeUnpin for UnlockedCredentials
impl UnwindSafe for UnlockedCredentials
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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