pub struct KeyStorage {
pub keys: HashMap<String, StoredKey>,
pub default_did: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A collection of stored keys
Fields§
§keys: HashMap<String, StoredKey>A map of DIDs to their stored keys
default_did: Option<String>The default DID to use when not specified
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last update timestamp
Implementations§
Source§impl KeyStorage
impl KeyStorage
Sourcepub fn default_key_path() -> Option<PathBuf>
pub fn default_key_path() -> Option<PathBuf>
Get the default key path
Sourcepub fn load_default() -> Result<Self>
pub fn load_default() -> Result<Self>
Load keys from the default location
Sourcepub fn load_from_path(path: &Path) -> Result<Self>
pub fn load_from_path(path: &Path) -> Result<Self>
Load keys from a specific path
Sourcepub fn save_default(&self) -> Result<()>
pub fn save_default(&self) -> Result<()>
Save keys to the default location
Sourcepub fn save_to_path(&self, path: &Path) -> Result<()>
pub fn save_to_path(&self, path: &Path) -> Result<()>
Save keys to a specific path
Sourcepub fn from_generated_key(key: &GeneratedKey) -> StoredKey
pub fn from_generated_key(key: &GeneratedKey) -> StoredKey
Convert a GeneratedKey to a StoredKey
Trait Implementations§
Source§impl Clone for KeyStorage
impl Clone for KeyStorage
Source§fn clone(&self) -> KeyStorage
fn clone(&self) -> KeyStorage
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 KeyStorage
impl Debug for KeyStorage
Source§impl Default for KeyStorage
impl Default for KeyStorage
Source§fn default() -> KeyStorage
fn default() -> KeyStorage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KeyStorage
impl<'de> Deserialize<'de> for KeyStorage
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
Auto Trait Implementations§
impl Freeze for KeyStorage
impl RefUnwindSafe for KeyStorage
impl Send for KeyStorage
impl Sync for KeyStorage
impl Unpin for KeyStorage
impl UnwindSafe for KeyStorage
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