/// Check if a given file is a certificate file.
Check if a given file is a certificate file.
Check if a given file is a certificate file .
fn is_cert_file<P: AsRef<Path>>(path: P) -> bool {
    let path = path.as_ref();
    if let Some(ext) = path.extension() {
        let ext = ext.to_string_lossy();
        match &ext.to_lowercase() as &str {
            "der" => true,
            "cer" => true,
            "crt" => true,
            "pem" => true,
            _ => false
        }
    } else {
        false
    }
}
fn is_cert_file < P : AsRef < Path > > ( path : P ) -> bool { let path = path . as_ref ( ) ; if let Some ( ext ) = path . extension ( ) { let ext = ext . to_string_lossy ( ) ; match & ext . to_lowercase ( ) as & str { " " => true , " " => true , " " => true , " " => true , _ => false } } else { false } }
Check if a given file is a certificate file.
Check if a given file is a certificate file .
path
P