diff options
| author | Steven Fackler <[email protected]> | 2016-11-13 17:56:48 +0000 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-11-13 17:56:48 +0000 |
| commit | ccef9e339dc3717761fc9e70c34f1df86b608579 (patch) | |
| tree | 83778d79877e81416f67ed06c5d0b0d01a309c04 /openssl/src/x509/mod.rs | |
| parent | Macroise to_pem (diff) | |
| download | rust-openssl-ccef9e339dc3717761fc9e70c34f1df86b608579.tar.xz rust-openssl-ccef9e339dc3717761fc9e70c34f1df86b608579.zip | |
Macroise from_pem
Diffstat (limited to 'openssl/src/x509/mod.rs')
| -rw-r--r-- | openssl/src/x509/mod.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index 8a739ec6..68652f8e 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -431,19 +431,8 @@ impl ToOwned for X509Ref { } impl X509 { + from_pem!(X509, ffi::PEM_read_bio_X509); from_der!(X509, ffi::d2i_X509); - - /// Reads a certificate from PEM. - pub fn from_pem(buf: &[u8]) -> Result<X509, ErrorStack> { - let mem_bio = try!(MemBioSlice::new(buf)); - unsafe { - let handle = try!(cvt_p(ffi::PEM_read_bio_X509(mem_bio.as_ptr(), - ptr::null_mut(), - None, - ptr::null_mut()))); - Ok(X509::from_ptr(handle)) - } - } } impl Clone for X509 { |