diff options
| author | David Weinstein <[email protected]> | 2016-08-03 15:56:38 -0400 |
|---|---|---|
| committer | David Weinstein <[email protected]> | 2016-08-17 01:23:54 -0400 |
| commit | f9cd4bff1f371336bc4f69298713069ce09825b7 (patch) | |
| tree | 4c29fc159904c468aad4a50ea15e8eebd95ff746 /openssl/src/x509/mod.rs | |
| parent | Merge pull request #440 from dweinstein/openssl-mirror (diff) | |
| download | rust-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.rs | 16 |
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()); |