pub use core::error::{Error, Result};
pub use core::options;
pub use core::encryption::{boxfile::Boxfile, cipher::{Checksum, Key, Nonce}};
use core::{key, profile};
pub mod app;
pub mod cli;
mod core;
pub fn encrypt(file_path: &std::path::Path, options: &mut options::EncryptionOptions) -> Result<()> {
core::encrypt(
file_path,
&options.password,
options.keep_original_name,
options.generate_padding,
options.encrypt_metadata,
&mut options.output_paths
)
}
pub fn decrypt(file_path: &std::path::Path, options: &mut options::DecryptionOptions) -> Result<()> {
core::decrypt(file_path, &options.password, &mut options.output_paths)
}
pub fn get_info(file_path: &std::path::Path, options: options::InformationOptions) -> Result<Vec<String>> {
core::get_info(file_path, options.show_unknown)
}
pub fn create_profile(profile_name: &str, options: options::ProfileCreateOptions) -> Result<()> {
profile::create(profile_name, &options.password)
}
pub fn delete_profile(profile_name: &str, options: options::ProfileDeleteOptions) -> Result<()> {
profile::delete(profile_name, &options.password)
}
pub fn select_profile(profile_name: &str, options: options::ProfileSelectOptions) -> Result<()> {
profile::select(profile_name, &options.password)
}
pub fn get_profile() -> Result<String> {
profile::get_current()
}
pub fn get_profiles() -> Result<Vec<String>> {
profile::get_all()
}
pub fn new_key(options: options::KeyNewOptions) -> Result<()> {
key::new(&options.password)
}
pub fn get_key(options: options::KeyGetOptions) -> Result<String> {
key::get(&options.password, options.as_byte_array)
}
pub fn set_key(new_key: &str, options: options::KeySetOptions) -> Result<()> {
key::set(new_key, &options.password)
}