This commit is contained in:
Adrian Heine 2017-04-26 09:19:02 +02:00
parent 7d629e38d8
commit 2ccc56a097
5 changed files with 32 additions and 4 deletions

View file

@ -3,6 +3,7 @@ use std::error::Error;
use std::fmt;
use command_runner::CommandRunner;
use resources::{Resource, FileResource};
use symbols::Symbol;
pub struct TlsCsr<'a> {
@ -50,6 +51,10 @@ impl<'a> Symbol for TlsCsr<'a> {
let output = try!(self.command_runner.run_with_args("openssl", &["req", "-new", "-sha256", "-key", &self.get_key_path(), "-out", &self.get_csr_path(), "-subj", &format!("/CN={}", self.domain)]).map_err(|e| Box::new(e)));
Ok(())
}
fn get_prerequisites(&self) -> Vec<Box<Resource>> {
vec![Box::new(FileResource { path: self.get_key_path().into() })]
}
}
#[cfg(test)]

View file

@ -3,6 +3,7 @@ use std::error::Error;
use std::fmt;
use command_runner::CommandRunner;
use resources::{Resource, FileResource};
use symbols::Symbol;
pub struct SelfSignedTlsCert<'a> {
@ -55,6 +56,10 @@ impl<'a> Symbol for SelfSignedTlsCert<'a> {
Ok(_) => Ok(())
}
}
fn get_prerequisites(&self) -> Vec<Box<Resource>> {
vec![Box::new(FileResource { path: self.get_key_path().into() })]
}
}
#[cfg(test)]