pub struct SecretKeyBox(/* private fields */);Expand description
A secret key and its metadata.
A SecretKeyBox represents a raw secret key, along with a key
identifier, an untrusted description, and information required to
decrypt it using a password.
This is what usually gets exported to disk.
A SecretKeyBox can be directly converted to/from a single-line string.
Implementations§
Source§impl SecretKeyBox
impl SecretKeyBox
Sourcepub fn from_string(s: &str) -> Result<SecretKeyBox>
pub fn from_string(s: &str) -> Result<SecretKeyBox>
Create a new SecretKeyBox from a string.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Return a SecretKeyBox for a string, for storage.
Sourcepub fn into_secret_key(self, password: Option<String>) -> Result<SecretKey>
pub fn into_secret_key(self, password: Option<String>) -> Result<SecretKey>
Convert a SecretKeyBox to a string, for storage.
If password is None, a password is going to be prompted interactively.
Sourcepub fn into_unencrypted_secret_key(self) -> Result<SecretKey>
pub fn into_unencrypted_secret_key(self) -> Result<SecretKey>
Convert an unencrypted SecretKeyBox to a string, for storage.
Trait Implementations§
Source§impl Clone for SecretKeyBox
impl Clone for SecretKeyBox
Source§fn clone(&self) -> SecretKeyBox
fn clone(&self) -> SecretKeyBox
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 SecretKeyBox
impl Debug for SecretKeyBox
Source§impl Display for SecretKeyBox
impl Display for SecretKeyBox
Source§impl From<SecretKeyBox> for String
impl From<SecretKeyBox> for String
Source§fn from(skb: SecretKeyBox) -> String
fn from(skb: SecretKeyBox) -> String
Converts to this type from the input type.
Source§impl From<String> for SecretKeyBox
impl From<String> for SecretKeyBox
Source§fn from(s: String) -> SecretKeyBox
fn from(s: String) -> SecretKeyBox
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SecretKeyBox
impl RefUnwindSafe for SecretKeyBox
impl Send for SecretKeyBox
impl Sync for SecretKeyBox
impl Unpin for SecretKeyBox
impl UnwindSafe for SecretKeyBox
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