pub enum Scope {
User,
Machine,
}
Expand description
Defines the encryption scope: user or machine
Variants§
User
Tied to current user account. Data can only be decrypted by the same user on the same machine. This is the most secure option for user-specific data.
§Security
- Data is encrypted using the current user’s credentials
- Only the same user on the same machine can decrypt the data
- If the user’s password changes, the data can still be decrypted
- If the user is deleted, the data cannot be decrypted
- Note: The decryption will only succeed if the data was encrypted with Scope::User by the same user. The scope flag is used during encryption to determine which key to use.
Machine
Tied to local machine. Data can be decrypted by any user on the same machine.
§Security
- Data is encrypted using the machine’s credentials
- Any user on the same machine can decrypt the data
- Useful for shared secrets that need to be accessible to all users
- Less secure than user scope as it’s accessible to all local users
- Note: The decryption will only succeed if the data was encrypted with Scope::Machine. The scope flag is used during encryption to determine which key to use.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
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