aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/x509/mod.rs
diff options
context:
space:
mode:
authorDavid Weinstein <[email protected]>2016-08-03 15:56:38 -0400
committerDavid Weinstein <[email protected]>2016-08-17 01:23:54 -0400
commitf9cd4bff1f371336bc4f69298713069ce09825b7 (patch)
tree4c29fc159904c468aad4a50ea15e8eebd95ff746 /openssl/src/x509/mod.rs
parentMerge pull request #440 from dweinstein/openssl-mirror (diff)
downloadrust-openssl-f9cd4bff1f371336bc4f69298713069ce09825b7.tar.xz
rust-openssl-f9cd4bff1f371336bc4f69298713069ce09825b7.zip
Progress on asn1 expiry
- Use MemBio and implement `Display` for Asn1Time - Tweak doc for asn1 `not_before`, `not_after`
Diffstat (limited to 'openssl/src/x509/mod.rs')
-rw-r--r--openssl/src/x509/mod.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index 0cc0eca7..851dd881 100644
--- a/openssl/src/x509/mod.rs
+++ b/openssl/src/x509/mod.rs
@@ -433,6 +433,22 @@ impl<'a> X509Ref<'a> {
}
}
+ /// Returns Issuer validity notAfter
+ pub fn not_after(&self) -> Asn1Time {
+ unsafe {
+ let date = ffi_extras::X509_get_notAfter(self.handle());
+ Asn1Time::from_raw(date)
+ }
+ }
+
+ /// Returns Issuer validity notBefore
+ pub fn not_before(&self) -> Asn1Time {
+ unsafe {
+ let date = ffi_extras::X509_get_notBefore(self.handle());
+ Asn1Time::from_raw(date)
+ }
+ }
+
/// Writes certificate as PEM
pub fn to_pem(&self) -> Result<Vec<u8>, ErrorStack> {
let mem_bio = try!(MemBio::new());