[−][src]Function libtls::config::load_file
pub fn load_file<P: AsRef<Path>>(
file: P,
password: Option<&str>
) -> Result<Vec<u8>>
Load a certificate or key file.
The load_file
function loads a certificate or key from disk into memory
to be used with set_ca_mem
, set_cert_mem
, set_crl_mem
or
set_key_mem
. A private key will be decrypted if the optional password
argument is specified.
Example
let data = config::load_file(filename, None)?; config::unload_file(data);