aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/rsa.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-11-13 18:00:42 +0000
committerSteven Fackler <[email protected]>2016-11-13 18:00:42 +0000
commit7dbef567e6cec78adb1d7ec55735935ca7de20fd (patch)
treedc168002d2e5100caf22fbde01bc120e81cc5101 /openssl/src/rsa.rs
parentMacroise from_pem (diff)
downloadrust-openssl-7dbef567e6cec78adb1d7ec55735935ca7de20fd.tar.xz
rust-openssl-7dbef567e6cec78adb1d7ec55735935ca7de20fd.zip
Remove some stray manual impls
Diffstat (limited to 'openssl/src/rsa.rs')
-rw-r--r--openssl/src/rsa.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/openssl/src/rsa.rs b/openssl/src/rsa.rs
index 68fc9584..8c3507f4 100644
--- a/openssl/src/rsa.rs
+++ b/openssl/src/rsa.rs
@@ -6,7 +6,7 @@ use libc::{c_int, c_void, c_char};
use {cvt, cvt_p, cvt_n};
use bn::{BigNum, BigNumRef};
-use bio::{MemBio, MemBioSlice};
+use bio::MemBioSlice;
use error::ErrorStack;
use util::{CallbackState, invoke_passwd_cb_old};
use types::OpenSslTypeRef;
@@ -23,17 +23,7 @@ type_!(Rsa, RsaRef, ffi::RSA, ffi::RSA_free);
impl RsaRef {
private_key_to_pem!(ffi::PEM_write_bio_RSAPrivateKey);
-
- /// Writes an RSA public key as PEM formatted data
- pub fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack> {
- let mem_bio = try!(MemBio::new());
-
- unsafe {
- try!(cvt(ffi::PEM_write_bio_RSA_PUBKEY(mem_bio.as_ptr(), self.as_ptr())));
- }
-
- Ok(mem_bio.get_buf().to_owned())
- }
+ public_key_to_pem!(ffi::PEM_write_bio_RSA_PUBKEY);
private_key_to_der!(ffi::i2d_RSAPrivateKey);
public_key_to_der!(ffi::i2d_RSA_PUBKEY);