mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-04 18:40:47 +00:00
refactor: use native path type
This commit is contained in:
parent
18c6b33f17
commit
1704564b61
1 changed files with 4 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ use secrecy::ExposeSecret;
|
||||||
use futures::io::{AsyncReadExt, AsyncWriteExt};
|
use futures::io::{AsyncReadExt, AsyncWriteExt};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use std::iter;
|
use std::iter;
|
||||||
|
use std::path::Path;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
/// Foolproof random 8 char string
|
/// Foolproof random 8 char string
|
||||||
|
|
@ -173,9 +174,9 @@ pub async fn decrypt_password_with_private_key(
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Massive refactor of encrypt_file_with_recipients required
|
// TODO: Massive refactor of encrypt_file_with_recipients required
|
||||||
pub async fn encrypt_file_with_recipients(
|
pub async fn encrypt_file_with_recipients<P: AsRef<Path>>(
|
||||||
plain_file_path: &str,
|
plain_file_path: P,
|
||||||
cipher_file_path: &str,
|
cipher_file_path: P,
|
||||||
recipients: Vec<&str>,
|
recipients: Vec<&str>,
|
||||||
) -> Result<(), age::EncryptError> {
|
) -> Result<(), age::EncryptError> {
|
||||||
let public_keys = recipients
|
let public_keys = recipients
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue