Struct encryptfile::Config [] [src]

pub struct Config { /* fields omitted */ }

The main Configuration type. This is a Builder object 1.

A config object can be reused; for instance, you can initially configure it for encryption using encrypt(), then switch it to decryption with decrypt().

Methods

impl Config
[src]

Constructs a new Config with default settings. At a minimum, you must set input streams and a password method, and configure it for encryption or decryption.

Enable decryption mode.

Enable encryption mode.

Set the input stream.

Set the output stream.

Set output options.

Add an output option.

Remove an output option.

Set the random number mode. See the RngMode enum for information on how this is used.

Set the method of determining the initialization vector.

Set the password method. Also clears the derived key.

Set the salt. Only used in password methods that require it; if not set, defaults to "DefaultSalt".

Set the encryption method.

Set the buffer size used for encryption and decryption. Default is 65536 bytes.

Derive the encryption key. The key is returned and is also cached on this object (accessible via get_derived_key()). See that function for details on how long this cached version persists.

It is not necessary to call this if you are just calling process() on a file. But it is useful if you want to use the key to decrypt many files, or if you want to use the key for other purposes (such as calculating HMACs).

Validate the encryption object; it is not necessary to call this manually since the configuration will be validated when it is used.

If derive_key() has been called, returns the derived encryption key. Otherwise returns None. Each time password() is called, the derived key will be reset to None.

Trait Implementations

impl Clone for Config
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more