mirror of
https://github.com/pcvolkmer/cert-tools.git
synced 2025-07-01 22:12:55 +00:00
feat: show if file is invalid
This commit is contained in:
@ -57,7 +57,7 @@ pub enum StringValue {
|
||||
impl Display for StringValue {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
StringValue::Valid(val) => write!(f, "{}", val),
|
||||
StringValue::Valid(val) => write!(f, "{val}"),
|
||||
StringValue::Invalid => write!(f, "*Invalid*"),
|
||||
StringValue::Empty => write!(f, "*Empty*"),
|
||||
}
|
||||
@ -271,6 +271,10 @@ impl Chain {
|
||||
return Err("Certificate chain contains invalid certificate".to_string());
|
||||
}
|
||||
|
||||
if certs.is_empty() {
|
||||
return Err("No Certificates found".to_string());
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
certs: certs.into_iter().flatten().collect::<Vec<_>>(),
|
||||
})
|
||||
|
Reference in New Issue
Block a user