Expose expire date certificate getter.
This commit is contained in:
parent
be3f658fbd
commit
25fade1fad
|
|
@ -30,7 +30,7 @@ pub struct Certificate {
|
||||||
subject: Option<String>,
|
subject: Option<String>,
|
||||||
issuer: Option<String>,
|
issuer: Option<String>,
|
||||||
start_date: Option<DateTime<Utc>>,
|
start_date: Option<DateTime<Utc>>,
|
||||||
pub expire_date: Option<DateTime<Utc>>,
|
expire_date: Option<DateTime<Utc>>,
|
||||||
pub serial_number: String,
|
pub serial_number: String,
|
||||||
pub subject_alt_name: Option<String>,
|
pub subject_alt_name: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
@ -66,6 +66,10 @@ impl Certificate {
|
||||||
pub fn start_date(&self) -> Option<DateTime<Utc>> {
|
pub fn start_date(&self) -> Option<DateTime<Utc>> {
|
||||||
self.start_date
|
self.start_date
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn expire_date(&self) -> Option<DateTime<Utc>> {
|
||||||
|
self.expire_date
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<CertInfo> for Certificate {
|
impl TryFrom<CertInfo> for Certificate {
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ impl CertificateJson {
|
||||||
subject: c.subject().cloned(),
|
subject: c.subject().cloned(),
|
||||||
issuer: c.issuer().cloned(),
|
issuer: c.issuer().cloned(),
|
||||||
start_date: c.start_date().map(|d| d.to_string()),
|
start_date: c.start_date().map(|d| d.to_string()),
|
||||||
expire_date: c.expire_date.map(|d| d.to_string()),
|
expire_date: c.expire_date().map(|d| d.to_string()),
|
||||||
serial_number: c.serial_number.to_string(),
|
serial_number: c.serial_number.to_string(),
|
||||||
subject_alt_name: c.subject_alt_name.clone(),
|
subject_alt_name: c.subject_alt_name.clone(),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ fn get_call_html(
|
||||||
if let Some(start_date) = start_date.as_ref() {
|
if let Some(start_date) = start_date.as_ref() {
|
||||||
values.push(("Start Date", start_date.as_str()));
|
values.push(("Start Date", start_date.as_str()));
|
||||||
}
|
}
|
||||||
let expire_date = certificate.expire_date.map(|d| d.to_string());
|
let expire_date = certificate.expire_date().map(|d| d.to_string());
|
||||||
if let Some(expire_date) = expire_date.as_ref() {
|
if let Some(expire_date) = expire_date.as_ref() {
|
||||||
values.push(("Expire Date", expire_date.as_str()));
|
values.push(("Expire Date", expire_date.as_str()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,7 @@ fn eval_query_certificate(
|
||||||
Some(date) => Value::Date(date),
|
Some(date) => Value::Date(date),
|
||||||
None => return Ok(None),
|
None => return Ok(None),
|
||||||
},
|
},
|
||||||
CertificateAttributeName::ExpireDate => match certificate.expire_date {
|
CertificateAttributeName::ExpireDate => match certificate.expire_date() {
|
||||||
Some(date) => Value::Date(date),
|
Some(date) => Value::Date(date),
|
||||||
None => return Ok(None),
|
None => return Ok(None),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue