diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2023-06-21 08:45:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-21 08:45:23 +0100 |
| commit | a75e516986ab2ba8b0997dd93271b58fa1986637 (patch) | |
| tree | 7f624df14403a3bbfe889247e1a2f989981452d1 /atuin-client/src/encryption.rs | |
| parent | Add RecordIndex data structure (#1059) (diff) | |
| download | atuin-a75e516986ab2ba8b0997dd93271b58fa1986637.zip | |
remove decryption from api-client (#1063)
Diffstat (limited to 'atuin-client/src/encryption.rs')
| -rw-r--r-- | atuin-client/src/encryption.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs index a7aec0e7..86125159 100644 --- a/atuin-client/src/encryption.rs +++ b/atuin-client/src/encryption.rs @@ -56,23 +56,6 @@ pub fn load_key(settings: &Settings) -> Result<Key> { Ok(key) } -pub fn load_encoded_key(settings: &Settings) -> Result<String> { - let path = settings.key_path.as_str(); - - if PathBuf::from(path).exists() { - let key = fs::read_to_string(path)?; - Ok(key) - } else { - let key = XSalsa20Poly1305::generate_key(&mut OsRng); - let encoded = encode_key(&key)?; - - let mut file = fs::File::create(path)?; - file.write_all(encoded.as_bytes())?; - - Ok(encoded) - } -} - pub fn encode_key(key: &Key) -> Result<String> { let mut buf = vec![]; rmp::encode::write_bin(&mut buf, key.as_slice()) |
