Struct lib_gistit::file::EncryptedFile [−][src]
pub struct EncryptedFile { /* fields omitted */ }
Expand description
Represents a encrypted gistit file data.
This data structure is expected to hold encrypted but not encoded bytes in encrypted_bytes
, the nonce
which is a 12 bytes randomly generated byte array, and a pointer to the previous unencrypted File
handler.
Implementations
Creates a new EncryptedFile
handler from encrypted and encoded byte array.
That means it should contain the expected encryption header and be base64 encoded.
Will create a new temporary file in your system temp
directory and write decoded and
still encrypted contents into it.
note that there is no prev
unencrypted File
handler
Errors
Fails with IoError
if can’t create or write to the file handler.
Fails with FileError
if the encryption header is invalid.
Set a file name, if attempt to decrypt without a file name this will be set to a random string.
Converts Self
into File
handler by applying the decryption process with the
provided secret.
Errors
Fails with EncryptionError
if nonce
or secret
is incorrect
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for EncryptedFile
impl Send for EncryptedFile
impl Sync for EncryptedFile
impl Unpin for EncryptedFile
impl !UnwindSafe for EncryptedFile
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more