// Load private key from file.
Load private key from file.
Load private key from file .
fn load_private_key(filename: &str) -> io::Result<rustls::PrivateKey> {
    // Open keyfile.
    let keyfile = get_tls_file(&filename)?;
    let mut reader = io::BufReader::new(keyfile);
    // Load and return a single private key.
    let keys = pemfile::rsa_private_keys(&mut reader)
        .map_err(|_| io_error("failed to load private key".into()))?;
    if keys.len() != 1 {
        return Err(io_error("expected a single private key".into()));
    }
    Ok(keys[0].clone())
}
fn load_private_key ( filename : & str ) -> io :: Result < rustls :: PrivateKey > { // Open keyfile. let keyfile = get_tls_file ( & filename ) ? ; let mut reader = io :: BufReader :: new ( keyfile ) ; // Load and return a single private key. let keys = pemfile :: rsa_private_keys ( & mut reader ) . map_err ( | _ | io_error ( " " . into ( ) ) ) ? ; if keys . len ( ) != 1 { return Err ( io_error ( " " . into ( ) ) ) ; } Ok ( keys [ 0 ] . clone ( ) ) }
Load private key from file.
Load private key from file .
filename
&str