pub enum StoredKey {
String(String),
Raw([u8; 32]),
}Expand description
Enum for storing different types of keys.
Variants§
String(String)
A base64-encoded string representation of a 32-byte key.
Raw([u8; 32])
Raw 32-byte key data.
Implementations§
Source§impl StoredKey
impl StoredKey
Sourcepub fn decode(&self) -> Result<[u8; 32], DecodeError>
pub fn decode(&self) -> Result<[u8; 32], DecodeError>
Decodes the stored key into a 32-byte array.
For String variants, decodes from base64. For Raw variants, returns the bytes directly.
§Errors
Returns DecodeError::Base64 if base64 decoding fails.
Returns DecodeError::Ed25519 if the decoded data is not exactly 32 bytes.
Trait Implementations§
impl Eq for StoredKey
impl StructuralPartialEq for StoredKey
Auto Trait Implementations§
impl Freeze for StoredKey
impl RefUnwindSafe for StoredKey
impl Send for StoredKey
impl Sync for StoredKey
impl Unpin for StoredKey
impl UnwindSafe for StoredKey
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.