diff options
| author | Steven Fackler <[email protected]> | 2016-11-13 16:52:19 +0000 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-11-13 16:52:19 +0000 |
| commit | b0415f466c4b62f949b1e47e6b1e703d1b24122b (patch) | |
| tree | 4cbe8cb2d812d10f22c7ed6ae2617f8fe50ecf62 /openssl/src/x509/mod.rs | |
| parent | Make password callback return a Result (diff) | |
| download | rust-openssl-b0415f466c4b62f949b1e47e6b1e703d1b24122b.tar.xz rust-openssl-b0415f466c4b62f949b1e47e6b1e703d1b24122b.zip | |
Macroise to_der
Diffstat (limited to 'openssl/src/x509/mod.rs')
| -rw-r--r-- | openssl/src/x509/mod.rs | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index e7c633d0..74f586c2 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -425,14 +425,7 @@ impl X509Ref { Ok(mem_bio.get_buf().to_owned()) } - /// Returns a DER serialized form of the certificate - pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack> { - let mem_bio = try!(MemBio::new()); - unsafe { - ffi::i2d_X509_bio(mem_bio.as_ptr(), self.as_ptr()); - } - Ok(mem_bio.get_buf().to_owned()) - } + to_der!(ffi::i2d_X509); } impl ToOwned for X509Ref { @@ -575,14 +568,7 @@ impl X509ReqRef { Ok(mem_bio.get_buf().to_owned()) } - /// Returns a DER serialized form of the CSR - pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack> { - let mem_bio = try!(MemBio::new()); - unsafe { - ffi::i2d_X509_REQ_bio(mem_bio.as_ptr(), self.as_ptr()); - } - Ok(mem_bio.get_buf().to_owned()) - } + to_der!(ffi::i2d_X509_REQ); } impl X509Req { |