pub fn create_certificate_request_pem(
    domain: &str,
    private_key_file: impl AsRef<Path>,
    output_file: impl AsRef<Path>,
) -> Result<String> {
    let cert_csr_pem = execute_and_parse_stdout(
        Command::new("openssl")
            .arg("req")
            .arg("-new")
            .arg("-sha256")
            .arg("-key")
            .arg(private_key_file.as_ref().as_os_str())
            .arg("-subj")
            .arg(format!("/CN={}/O=Test/C=US", domain)),
    )?;
    write_new_file(output_file, &cert_csr_pem)?;
    Ok(cert_csr_pem)
}
/// Generates a certificate request, and returns it in PEM format.
/// Writes PEM to `output_file`.
/// Returns error if `output_file` already exists.
Generates a certificate request, and returns it in PEM format.
Writes PEM to `output_file`.
Returns error if `output_file` already exists.
Generates a certificate request and returns it in PEM format . Writes PEM to ` output_file ` . Returns error if ` output_file ` already exists .
pub fn create_certificate_request_pem(
    domain: &str,
    private_key_file: impl AsRef<Path>,
    output_file: impl AsRef<Path>,
) -> Result<String> {
    let cert_csr_pem = execute_and_parse_stdout(
        Command::new("openssl")
            .arg("req")
            .arg("-new")
            .arg("-sha256")
            .arg("-key")
            .arg(private_key_file.as_ref().as_os_str())
            .arg("-subj")
            .arg(format!("/CN={}/O=Test/C=US", domain)),
    )?;
    write_new_file(output_file, &cert_csr_pem)?;
    Ok(cert_csr_pem)
}
pub fn create_certificate_request_pem ( domain : & str , private_key_file : impl AsRef < Path > , output_file : impl AsRef < Path > , ) -> Result < String > { let cert_csr_pem = execute_and_parse_stdout ( Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( private_key_file . as_ref ( ) . as_os_str ( ) ) . arg ( " " ) . arg ( format ! ( " " domain ) ) , ) ? ; write_new_file ( output_file , & cert_csr_pem ) ? ; Ok ( cert_csr_pem ) }
Generates a certificate request, and returns it in PEM format.
Generates a certificate request and returns it in PEM format .
domain
&str
private_key_file
impl AsRef<Path>
output_file
impl AsRef<Path>
domain
&str
private_key_file
impl AsRef<Path>
output_file
impl AsRef<Path>