1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//! Provides structs which hold optional parameters for the API functions for easier option supply
use std::{collections::VecDeque, path::PathBuf};
pub struct EncryptionOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
/// Don't replace the name with a random UUID for the encrypted file
pub keep_original_name: bool,
/// Generate random padding bytes and append them to the file. If set
/// to false, can save some disk space for the file
pub generate_padding: bool,
/// Whether to encrypt original file metadata like file name, extension, modify time, etc.
/// Enabling this feature provides better data protection, but the file will be unable to parse
/// from the outside without properly decrypting (e.g. encrypted file search by its original
/// name will be unavailable)
pub encrypt_metadata: bool,
/// Contains an output path for each file
pub output_paths: Option<VecDeque<PathBuf>>
}
impl Default for EncryptionOptions<'_> {
fn default() -> Self {
EncryptionOptions {
password: None,
keep_original_name: false,
generate_padding: true,
encrypt_metadata: false,
output_paths: None,
}
}
}
pub struct DecryptionOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
/// Contains an output path for each file
pub output_paths: Option<VecDeque<PathBuf>>
}
impl Default for DecryptionOptions<'_> {
fn default() -> Self {
DecryptionOptions {
password: None,
output_paths: None,
}
}
}
pub struct InformationOptions {
/// Show unknown metadata with the rest
pub show_unknown: bool,
}
impl Default for InformationOptions {
fn default() -> Self {
InformationOptions {
show_unknown: false,
}
}
}
pub struct ProfileCreateOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
}
impl Default for ProfileCreateOptions<'_> {
fn default() -> Self {
ProfileCreateOptions {
password: None,
}
}
}
pub struct ProfileDeleteOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
}
impl Default for ProfileDeleteOptions<'_> {
fn default() -> Self {
ProfileDeleteOptions {
password: None,
}
}
}
pub struct ProfileSelectOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
}
impl Default for ProfileSelectOptions<'_> {
fn default() -> Self {
ProfileSelectOptions {
password: None,
}
}
}
pub struct KeyNewOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
}
impl Default for KeyNewOptions<'_> {
fn default() -> Self {
KeyNewOptions {
password: None,
}
}
}
pub struct KeyGetOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
/// Format encryption key as list of bytes
pub as_byte_array: bool
}
impl Default for KeyGetOptions<'_> {
fn default() -> Self {
KeyGetOptions {
password: None,
as_byte_array: false,
}
}
}
pub struct KeySetOptions<'a> {
/// Pre-supplied password for authentication
pub password: Option<&'a String>,
}
impl Default for KeySetOptions<'_> {
fn default() -> Self {
KeySetOptions {
password: None,
}
}
}